diff --git a/docs/admin_client/admin_client_usage.rst b/docs/admin_client/admin_client_usage.rst index 8c6f4a5dc..f0f29d81b 100644 --- a/docs/admin_client/admin_client_usage.rst +++ b/docs/admin_client/admin_client_usage.rst @@ -8,4 +8,4 @@ Admin Client .. This should be the only handwritten RST file in this directory. - Everything else should be autogenerated. + Everything else should be autogenerated. \ No newline at end of file diff --git a/docs/admin_client/bigtable_instance_admin.rst b/docs/admin_client/bigtable_instance_admin.rst index 42f7caad7..b2cdf143c 100644 --- a/docs/admin_client/bigtable_instance_admin.rst +++ b/docs/admin_client/bigtable_instance_admin.rst @@ -1,10 +1,10 @@ BigtableInstanceAdmin --------------------------------------- -.. automodule:: google.cloud.bigtable_admin_v2.services.bigtable_instance_admin +.. automodule:: google.cloud.bigtable.admin.services.bigtable_instance_admin :members: :inherited-members: -.. automodule:: google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers +.. automodule:: google.cloud.bigtable.admin.services.bigtable_instance_admin.pagers :members: :inherited-members: diff --git a/docs/admin_client/bigtable_table_admin.rst b/docs/admin_client/bigtable_table_admin.rst index 0fa4b276a..52acadd8d 100644 --- a/docs/admin_client/bigtable_table_admin.rst +++ b/docs/admin_client/bigtable_table_admin.rst @@ -1,10 +1,10 @@ BigtableTableAdmin ------------------------------------ -.. automodule:: google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin +.. automodule:: google.cloud.bigtable.admin.overlay.services.bigtable_table_admin :members: :inherited-members: -.. automodule:: google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers +.. automodule:: google.cloud.bigtable.admin.services.bigtable_table_admin.pagers :members: :inherited-members: diff --git a/docs/admin_client/types_.rst b/docs/admin_client/types_.rst index ef32b9684..f8f68997f 100644 --- a/docs/admin_client/types_.rst +++ b/docs/admin_client/types_.rst @@ -1,10 +1,10 @@ Types for Google Cloud Bigtable Admin v2 API ============================================ -.. automodule:: google.cloud.bigtable_admin_v2.types +.. automodule:: google.cloud.bigtable.admin.types :members: :show-inheritance: -.. automodule:: google.cloud.bigtable_admin_v2.overlay.types +.. automodule:: google.cloud.bigtable.admin.overlay.types :members: :show-inheritance: diff --git a/docs/scripts/patch_devsite_toc.py b/docs/scripts/patch_devsite_toc.py index fbb753daf..302045738 100644 --- a/docs/scripts/patch_devsite_toc.py +++ b/docs/scripts/patch_devsite_toc.py @@ -252,9 +252,9 @@ def validate_toc(toc_file_path, expected_section_list, added_sections): TocSection(dir_name="data_client", index_file_name="data_client_usage.rst"), UIDFilteredTocSection( toc_file_path=toc_path, - section_name="Bigtable Admin V2", + section_name="Bigtable", title="Admin Client", - uid_prefix="google.cloud.bigtable_admin_v2", + uid_prefix="google.cloud.bigtable.admin", ), TocSection(dir_name="classic_client", index_file_name="usage.rst"), ] diff --git a/google/cloud/bigtable/admin/__init__.py b/google/cloud/bigtable/admin/__init__.py new file mode 100644 index 000000000..93d160c6f --- /dev/null +++ b/google/cloud/bigtable/admin/__init__.py @@ -0,0 +1,274 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.cloud.bigtable.admin import gapic_version as package_version + +__version__ = package_version.__version__ + + +from .services.bigtable_instance_admin import BigtableInstanceAdminClient +from .services.bigtable_instance_admin import BigtableInstanceAdminAsyncClient +from .services.bigtable_table_admin import BaseBigtableTableAdminClient +from .services.bigtable_table_admin import BaseBigtableTableAdminAsyncClient + +from .types.bigtable_instance_admin import CreateAppProfileRequest +from .types.bigtable_instance_admin import CreateClusterMetadata +from .types.bigtable_instance_admin import CreateClusterRequest +from .types.bigtable_instance_admin import CreateInstanceMetadata +from .types.bigtable_instance_admin import CreateInstanceRequest +from .types.bigtable_instance_admin import CreateLogicalViewMetadata +from .types.bigtable_instance_admin import CreateLogicalViewRequest +from .types.bigtable_instance_admin import CreateMaterializedViewMetadata +from .types.bigtable_instance_admin import CreateMaterializedViewRequest +from .types.bigtable_instance_admin import DeleteAppProfileRequest +from .types.bigtable_instance_admin import DeleteClusterRequest +from .types.bigtable_instance_admin import DeleteInstanceRequest +from .types.bigtable_instance_admin import DeleteLogicalViewRequest +from .types.bigtable_instance_admin import DeleteMaterializedViewRequest +from .types.bigtable_instance_admin import GetAppProfileRequest +from .types.bigtable_instance_admin import GetClusterRequest +from .types.bigtable_instance_admin import GetInstanceRequest +from .types.bigtable_instance_admin import GetLogicalViewRequest +from .types.bigtable_instance_admin import GetMaterializedViewRequest +from .types.bigtable_instance_admin import ListAppProfilesRequest +from .types.bigtable_instance_admin import ListAppProfilesResponse +from .types.bigtable_instance_admin import ListClustersRequest +from .types.bigtable_instance_admin import ListClustersResponse +from .types.bigtable_instance_admin import ListHotTabletsRequest +from .types.bigtable_instance_admin import ListHotTabletsResponse +from .types.bigtable_instance_admin import ListInstancesRequest +from .types.bigtable_instance_admin import ListInstancesResponse +from .types.bigtable_instance_admin import ListLogicalViewsRequest +from .types.bigtable_instance_admin import ListLogicalViewsResponse +from .types.bigtable_instance_admin import ListMaterializedViewsRequest +from .types.bigtable_instance_admin import ListMaterializedViewsResponse +from .types.bigtable_instance_admin import PartialUpdateClusterMetadata +from .types.bigtable_instance_admin import PartialUpdateClusterRequest +from .types.bigtable_instance_admin import PartialUpdateInstanceRequest +from .types.bigtable_instance_admin import UpdateAppProfileMetadata +from .types.bigtable_instance_admin import UpdateAppProfileRequest +from .types.bigtable_instance_admin import UpdateClusterMetadata +from .types.bigtable_instance_admin import UpdateInstanceMetadata +from .types.bigtable_instance_admin import UpdateLogicalViewMetadata +from .types.bigtable_instance_admin import UpdateLogicalViewRequest +from .types.bigtable_instance_admin import UpdateMaterializedViewMetadata +from .types.bigtable_instance_admin import UpdateMaterializedViewRequest +from .types.bigtable_table_admin import CheckConsistencyRequest +from .types.bigtable_table_admin import CheckConsistencyResponse +from .types.bigtable_table_admin import CopyBackupMetadata +from .types.bigtable_table_admin import CopyBackupRequest +from .types.bigtable_table_admin import CreateAuthorizedViewMetadata +from .types.bigtable_table_admin import CreateAuthorizedViewRequest +from .types.bigtable_table_admin import CreateBackupMetadata +from .types.bigtable_table_admin import CreateBackupRequest +from .types.bigtable_table_admin import CreateSchemaBundleMetadata +from .types.bigtable_table_admin import CreateSchemaBundleRequest +from .types.bigtable_table_admin import CreateTableFromSnapshotMetadata +from .types.bigtable_table_admin import CreateTableFromSnapshotRequest +from .types.bigtable_table_admin import CreateTableRequest +from .types.bigtable_table_admin import DataBoostReadLocalWrites +from .types.bigtable_table_admin import DeleteAuthorizedViewRequest +from .types.bigtable_table_admin import DeleteBackupRequest +from .types.bigtable_table_admin import DeleteSchemaBundleRequest +from .types.bigtable_table_admin import DeleteSnapshotRequest +from .types.bigtable_table_admin import DeleteTableRequest +from .types.bigtable_table_admin import DropRowRangeRequest +from .types.bigtable_table_admin import GenerateConsistencyTokenRequest +from .types.bigtable_table_admin import GenerateConsistencyTokenResponse +from .types.bigtable_table_admin import GetAuthorizedViewRequest +from .types.bigtable_table_admin import GetBackupRequest +from .types.bigtable_table_admin import GetSchemaBundleRequest +from .types.bigtable_table_admin import GetSnapshotRequest +from .types.bigtable_table_admin import GetTableRequest +from .types.bigtable_table_admin import ListAuthorizedViewsRequest +from .types.bigtable_table_admin import ListAuthorizedViewsResponse +from .types.bigtable_table_admin import ListBackupsRequest +from .types.bigtable_table_admin import ListBackupsResponse +from .types.bigtable_table_admin import ListSchemaBundlesRequest +from .types.bigtable_table_admin import ListSchemaBundlesResponse +from .types.bigtable_table_admin import ListSnapshotsRequest +from .types.bigtable_table_admin import ListSnapshotsResponse +from .types.bigtable_table_admin import ListTablesRequest +from .types.bigtable_table_admin import ListTablesResponse +from .types.bigtable_table_admin import ModifyColumnFamiliesRequest +from .types.bigtable_table_admin import OptimizeRestoredTableMetadata +from .types.bigtable_table_admin import RestoreTableMetadata +from .types.bigtable_table_admin import RestoreTableRequest +from .types.bigtable_table_admin import SnapshotTableMetadata +from .types.bigtable_table_admin import SnapshotTableRequest +from .types.bigtable_table_admin import StandardReadRemoteWrites +from .types.bigtable_table_admin import UndeleteTableMetadata +from .types.bigtable_table_admin import UndeleteTableRequest +from .types.bigtable_table_admin import UpdateAuthorizedViewMetadata +from .types.bigtable_table_admin import UpdateAuthorizedViewRequest +from .types.bigtable_table_admin import UpdateBackupRequest +from .types.bigtable_table_admin import UpdateSchemaBundleMetadata +from .types.bigtable_table_admin import UpdateSchemaBundleRequest +from .types.bigtable_table_admin import UpdateTableMetadata +from .types.bigtable_table_admin import UpdateTableRequest +from .types.common import OperationProgress +from .types.common import StorageType +from .types.instance import AppProfile +from .types.instance import AutoscalingLimits +from .types.instance import AutoscalingTargets +from .types.instance import Cluster +from .types.instance import HotTablet +from .types.instance import Instance +from .types.instance import LogicalView +from .types.instance import MaterializedView +from .types.table import AuthorizedView +from .types.table import Backup +from .types.table import BackupInfo +from .types.table import ChangeStreamConfig +from .types.table import ColumnFamily +from .types.table import EncryptionInfo +from .types.table import GcRule +from .types.table import ProtoSchema +from .types.table import RestoreInfo +from .types.table import SchemaBundle +from .types.table import Snapshot +from .types.table import Table +from .types.table import RestoreSourceType +from .types.types import Type + +__all__ = ( + "BaseBigtableTableAdminAsyncClient", + "BigtableInstanceAdminAsyncClient", + "AppProfile", + "AuthorizedView", + "AutoscalingLimits", + "AutoscalingTargets", + "Backup", + "BackupInfo", + "BaseBigtableTableAdminClient", + "BigtableInstanceAdminClient", + "ChangeStreamConfig", + "CheckConsistencyRequest", + "CheckConsistencyResponse", + "Cluster", + "ColumnFamily", + "CopyBackupMetadata", + "CopyBackupRequest", + "CreateAppProfileRequest", + "CreateAuthorizedViewMetadata", + "CreateAuthorizedViewRequest", + "CreateBackupMetadata", + "CreateBackupRequest", + "CreateClusterMetadata", + "CreateClusterRequest", + "CreateInstanceMetadata", + "CreateInstanceRequest", + "CreateLogicalViewMetadata", + "CreateLogicalViewRequest", + "CreateMaterializedViewMetadata", + "CreateMaterializedViewRequest", + "CreateSchemaBundleMetadata", + "CreateSchemaBundleRequest", + "CreateTableFromSnapshotMetadata", + "CreateTableFromSnapshotRequest", + "CreateTableRequest", + "DataBoostReadLocalWrites", + "DeleteAppProfileRequest", + "DeleteAuthorizedViewRequest", + "DeleteBackupRequest", + "DeleteClusterRequest", + "DeleteInstanceRequest", + "DeleteLogicalViewRequest", + "DeleteMaterializedViewRequest", + "DeleteSchemaBundleRequest", + "DeleteSnapshotRequest", + "DeleteTableRequest", + "DropRowRangeRequest", + "EncryptionInfo", + "GcRule", + "GenerateConsistencyTokenRequest", + "GenerateConsistencyTokenResponse", + "GetAppProfileRequest", + "GetAuthorizedViewRequest", + "GetBackupRequest", + "GetClusterRequest", + "GetInstanceRequest", + "GetLogicalViewRequest", + "GetMaterializedViewRequest", + "GetSchemaBundleRequest", + "GetSnapshotRequest", + "GetTableRequest", + "HotTablet", + "Instance", + "ListAppProfilesRequest", + "ListAppProfilesResponse", + "ListAuthorizedViewsRequest", + "ListAuthorizedViewsResponse", + "ListBackupsRequest", + "ListBackupsResponse", + "ListClustersRequest", + "ListClustersResponse", + "ListHotTabletsRequest", + "ListHotTabletsResponse", + "ListInstancesRequest", + "ListInstancesResponse", + "ListLogicalViewsRequest", + "ListLogicalViewsResponse", + "ListMaterializedViewsRequest", + "ListMaterializedViewsResponse", + "ListSchemaBundlesRequest", + "ListSchemaBundlesResponse", + "ListSnapshotsRequest", + "ListSnapshotsResponse", + "ListTablesRequest", + "ListTablesResponse", + "LogicalView", + "MaterializedView", + "ModifyColumnFamiliesRequest", + "OperationProgress", + "OptimizeRestoredTableMetadata", + "PartialUpdateClusterMetadata", + "PartialUpdateClusterRequest", + "PartialUpdateInstanceRequest", + "ProtoSchema", + "RestoreInfo", + "RestoreSourceType", + "RestoreTableMetadata", + "RestoreTableRequest", + "SchemaBundle", + "Snapshot", + "SnapshotTableMetadata", + "SnapshotTableRequest", + "StandardReadRemoteWrites", + "StorageType", + "Table", + "Type", + "UndeleteTableMetadata", + "UndeleteTableRequest", + "UpdateAppProfileMetadata", + "UpdateAppProfileRequest", + "UpdateAuthorizedViewMetadata", + "UpdateAuthorizedViewRequest", + "UpdateBackupRequest", + "UpdateClusterMetadata", + "UpdateInstanceMetadata", + "UpdateLogicalViewMetadata", + "UpdateLogicalViewRequest", + "UpdateMaterializedViewMetadata", + "UpdateMaterializedViewRequest", + "UpdateSchemaBundleMetadata", + "UpdateSchemaBundleRequest", + "UpdateTableMetadata", + "UpdateTableRequest", +) + +from .overlay import * # noqa: F403 + +__all__ += overlay.__all__ # noqa: F405 diff --git a/google/cloud/bigtable_admin_v2/gapic_metadata.json b/google/cloud/bigtable/admin/gapic_metadata.json similarity index 99% rename from google/cloud/bigtable_admin_v2/gapic_metadata.json rename to google/cloud/bigtable/admin/gapic_metadata.json index 9725d3384..06297b900 100644 --- a/google/cloud/bigtable_admin_v2/gapic_metadata.json +++ b/google/cloud/bigtable/admin/gapic_metadata.json @@ -1,7 +1,7 @@ { "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "python", - "libraryPackage": "google.cloud.bigtable_admin_v2", + "libraryPackage": "google.cloud.bigtable.admin", "protoPackage": "google.bigtable.admin.v2", "schema": "1.0", "services": { diff --git a/google/cloud/bigtable_admin/gapic_version.py b/google/cloud/bigtable/admin/gapic_version.py similarity index 100% rename from google/cloud/bigtable_admin/gapic_version.py rename to google/cloud/bigtable/admin/gapic_version.py diff --git a/google/cloud/bigtable_admin_v2/overlay/__init__.py b/google/cloud/bigtable/admin/overlay/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/overlay/__init__.py rename to google/cloud/bigtable/admin/overlay/__init__.py diff --git a/google/cloud/bigtable_admin_v2/overlay/services/__init__.py b/google/cloud/bigtable/admin/overlay/services/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/overlay/services/__init__.py rename to google/cloud/bigtable/admin/overlay/services/__init__.py diff --git a/google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/__init__.py b/google/cloud/bigtable/admin/overlay/services/bigtable_table_admin/__init__.py similarity index 93% rename from google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/__init__.py rename to google/cloud/bigtable/admin/overlay/services/bigtable_table_admin/__init__.py index f80e3234f..873ffd9ac 100644 --- a/google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/__init__.py +++ b/google/cloud/bigtable/admin/overlay/services/bigtable_table_admin/__init__.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# TODO: Add the async client after owlbot changes. - from .async_client import BigtableTableAdminAsyncClient from .client import BigtableTableAdminClient diff --git a/google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/async_client.py b/google/cloud/bigtable/admin/overlay/services/bigtable_table_admin/async_client.py similarity index 90% rename from google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/async_client.py rename to google/cloud/bigtable/admin/overlay/services/bigtable_table_admin/async_client.py index ee8e5757d..2ed4b9b72 100644 --- a/google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/async_client.py +++ b/google/cloud/bigtable/admin/overlay/services/bigtable_table_admin/async_client.py @@ -42,15 +42,15 @@ from google.api_core import client_options as client_options_lib from google.auth import credentials as ga_credentials # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( +from google.cloud.bigtable.admin.services.bigtable_table_admin import ( async_client as base_client, ) -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports.base import ( +from google.cloud.bigtable.admin.services.bigtable_table_admin.transports.base import ( BigtableTableAdminTransport, ) -from google.cloud.bigtable_admin_v2.overlay.types import ( +from google.cloud.bigtable.admin.overlay.types import ( async_consistency, async_restore_table, wait_for_consistency_request, @@ -144,15 +144,15 @@ async def restore_table( ) -> async_restore_table.AsyncRestoreTableOperation: r"""Create a new table by restoring from a completed backup. The returned table :class:`long-running operation - ` + ` can be used to track the progress of the operation, and to cancel it. The :attr:`metadata ` field type is - :class:`RestoreTableMetadata `. + :class:`RestoreTableMetadata `. The :meth:`response ` type is - :class:`google.cloud.bigtable_admin_v2.types.Table`, if successful. + :class:`google.cloud.bigtable.admin.types.Table`, if successful. - Additionally, the returned :class:`long-running-operation ` - provides a method, :meth:`google.cloud.bigtable_admin_v2.overlay.types.async_restore_table.AsyncRestoreTableOperation.optimize_restore_table_operation` that + Additionally, the returned :class:`long-running-operation ` + provides a method, :meth:`google.cloud.bigtable.admin.overlay.types.async_restore_table.AsyncRestoreTableOperation.optimize_restore_table_operation` that provides access to a :class:`google.api_core.operation_async.AsyncOperation` object representing the OptimizeRestoreTable long-running-operation after the current one has completed. @@ -165,14 +165,14 @@ async def restore_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud.bigtable import admin_v2 + from google.cloud.bigtable import admin async def sample_restore_table(): # Create a client - client = admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = admin_v2.RestoreTableRequest( + request = admin.RestoreTableRequest( backup="backup_value", parent="parent_value", table_id="table_id_value", @@ -197,9 +197,9 @@ async def sample_restore_table(): response = await optimize_operation.result() Args: - request (Union[google.cloud.bigtable_admin_v2.types.RestoreTableRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.RestoreTableRequest, dict]): The request object. The request for - [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. + [RestoreTable][google.bigtable.admin.BigtableTableAdmin.RestoreTable]. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -209,10 +209,10 @@ async def sample_restore_table(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.overlay.types.async_restore_table.AsyncRestoreTableOperation: + google.cloud.bigtable.admin.overlay.types.async_restore_table.AsyncRestoreTableOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp. + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Table` A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster. """ @@ -253,14 +253,14 @@ async def wait_for_consistency( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud.bigtable import admin_v2 + from google.cloud.bigtable import admin async def sample_wait_for_consistency(): # Create a client - client = admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = admin_v2.WaitForConsistencyRequest( + request = admin.WaitForConsistencyRequest( name="name_value", ) @@ -273,7 +273,7 @@ async def sample_wait_for_consistency(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.overlay.types.WaitForConsistencyRequest, dict]): + request (Union[google.cloud.bigtable.admin.overlay.types.WaitForConsistencyRequest, dict]): The request object. name (str): Required. The unique name of the Table for which to diff --git a/google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/client.py b/google/cloud/bigtable/admin/overlay/services/bigtable_table_admin/client.py similarity index 89% rename from google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/client.py rename to google/cloud/bigtable/admin/overlay/services/bigtable_table_admin/client.py index 1b6770b10..fcd7df07c 100644 --- a/google/cloud/bigtable_admin_v2/overlay/services/bigtable_table_admin/client.py +++ b/google/cloud/bigtable/admin/overlay/services/bigtable_table_admin/client.py @@ -42,17 +42,17 @@ from google.api_core import client_options as client_options_lib from google.auth import credentials as ga_credentials # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( +from google.cloud.bigtable.admin.services.bigtable_table_admin import ( client as base_client, ) -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports.base import ( +from google.cloud.bigtable.admin.services.bigtable_table_admin.transports.base import ( BigtableTableAdminTransport, ) -from google.cloud.bigtable_admin_v2.overlay.types import ( +from google.cloud.bigtable.admin.overlay.types import ( consistency, - restore_table, + restore_table as restore_table_lro, wait_for_consistency_request, ) @@ -141,18 +141,18 @@ def restore_table( retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), - ) -> restore_table.RestoreTableOperation: + ) -> restore_table_lro.RestoreTableOperation: r"""Create a new table by restoring from a completed backup. The returned table :class:`long-running operation - ` + ` can be used to track the progress of the operation, and to cancel it. The :attr:`metadata ` field type is - :class:`RestoreTableMetadata `. + :class:`RestoreTableMetadata `. The :meth:`response ` type is - :class:`google.cloud.bigtable_admin_v2.types.Table`, if successful. + :class:`google.cloud.bigtable.admin.types.Table`, if successful. - Additionally, the returned :class:`long-running-operation ` - provides a method, :meth:`google.cloud.bigtable_admin_v2.overlay.types.restore_table.RestoreTableOperation.optimize_restore_table_operation` that + Additionally, the returned :class:`long-running-operation ` + provides a method, :meth:`google.cloud.bigtable.admin.overlay.types.restore_table.RestoreTableOperation.optimize_restore_table_operation` that provides access to a :class:`google.api_core.operation.Operation` object representing the OptimizeRestoreTable long-running-operation after the current one has completed. @@ -165,14 +165,14 @@ def restore_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud.bigtable import admin_v2 + from google.cloud.bigtable import admin def sample_restore_table(): # Create a client - client = admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = admin_v2.RestoreTableRequest( + request = admin.RestoreTableRequest( backup="backup_value", parent="parent_value", table_id="table_id_value", @@ -197,9 +197,9 @@ def sample_restore_table(): response = optimize_operation.result() Args: - request (Union[google.cloud.bigtable_admin_v2.types.RestoreTableRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.RestoreTableRequest, dict]): The request object. The request for - [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. + [RestoreTable][google.bigtable.admin.BigtableTableAdmin.RestoreTable]. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -209,10 +209,10 @@ def sample_restore_table(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.overlay.types.restore_table.RestoreTableOperation: + google.cloud.bigtable.admin.overlay.types.restore_table.RestoreTableOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp. + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Table` A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster. """ @@ -223,7 +223,7 @@ def sample_restore_table(): metadata=metadata, ) - restore_table_operation = restore_table.RestoreTableOperation( + restore_table_operation = restore_table_lro.RestoreTableOperation( self._transport.operations_client, operation ) return restore_table_operation @@ -253,14 +253,14 @@ def wait_for_consistency( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud.bigtable import admin_v2 + from google.cloud.bigtable import admin def sample_wait_for_consistency(): # Create a client - client = admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = admin_v2.WaitForConsistencyRequest( + request = admin.WaitForConsistencyRequest( name="name_value", ) @@ -273,7 +273,7 @@ def sample_wait_for_consistency(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.overlay.types.WaitForConsistencyRequest, dict]): + request (Union[google.cloud.bigtable.admin.overlay.types.WaitForConsistencyRequest, dict]): The request object. name (str): Required. The unique name of the Table for which to diff --git a/google/cloud/bigtable_admin_v2/overlay/types/__init__.py b/google/cloud/bigtable/admin/overlay/types/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/overlay/types/__init__.py rename to google/cloud/bigtable/admin/overlay/types/__init__.py diff --git a/google/cloud/bigtable_admin_v2/overlay/types/async_consistency.py b/google/cloud/bigtable/admin/overlay/types/async_consistency.py similarity index 83% rename from google/cloud/bigtable_admin_v2/overlay/types/async_consistency.py rename to google/cloud/bigtable/admin/overlay/types/async_consistency.py index 0703940d5..705eeb20d 100644 --- a/google/cloud/bigtable_admin_v2/overlay/types/async_consistency.py +++ b/google/cloud/bigtable/admin/overlay/types/async_consistency.py @@ -17,7 +17,7 @@ from google.api_core.future import async_future from google.api_core import gapic_v1 from google.api_core import retry as retries -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import bigtable_table_admin try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] @@ -34,24 +34,24 @@ class _AsyncCheckConsistencyPollingFuture(async_future.AsyncFuture): **This class should not be instantiated by users** and should only be instantiated by the admin client's - :meth:`google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.AsyncBigtableTableAdminClient.wait_for_consistency` + :meth:`google.cloud.bigtable.admin.overlay.services.bigtable_table_admin.AsyncBigtableTableAdminClient.wait_for_consistency` or - :meth:`google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.AsyncBigtableTableAdminClient.wait_for_replication` + :meth:`google.cloud.bigtable.admin.overlay.services.bigtable_table_admin.AsyncBigtableTableAdminClient.wait_for_replication` methods. Args: check_consistency_call(Callable[ [Optional[google.api_core.retry.Retry], - google.cloud.bigtable_admin_v2.types.CheckConsistencyResponse]): + google.cloud.bigtable.admin.types.CheckConsistencyResponse]): A :meth:`check_consistency - ` + ` call from the admin client. The call should fix every user parameter except for retry, which will be done via :meth:`functools.partial`. default_retry(Optional[google.api_core.retry.Retry]): The `retry` parameter passed in to either :meth:`wait_for_consistency - ` + ` or :meth:`wait_for_replication - ` + ` retry (google.api_core.retry.AsyncRetry): The retry configuration used when polling. This can be used to control how often :meth:`done` is polled. Regardless of the retry's ``deadline``, it will be diff --git a/google/cloud/bigtable_admin_v2/overlay/types/async_restore_table.py b/google/cloud/bigtable/admin/overlay/types/async_restore_table.py similarity index 95% rename from google/cloud/bigtable_admin_v2/overlay/types/async_restore_table.py rename to google/cloud/bigtable/admin/overlay/types/async_restore_table.py index 9edfb4963..9b465e313 100644 --- a/google/cloud/bigtable_admin_v2/overlay/types/async_restore_table.py +++ b/google/cloud/bigtable/admin/overlay/types/async_restore_table.py @@ -18,7 +18,7 @@ from google.api_core import operation_async from google.protobuf import empty_pb2 -from google.cloud.bigtable_admin_v2.types import OptimizeRestoredTableMetadata +from google.cloud.bigtable.admin.types import OptimizeRestoredTableMetadata class AsyncRestoreTableOperation(operation_async.AsyncOperation): @@ -30,7 +30,7 @@ class AsyncRestoreTableOperation(operation_async.AsyncOperation): **This class should not be instantiated by users** and should only be instantiated by the admin client's :meth:`restore_table - ` + ` method. Args: diff --git a/google/cloud/bigtable_admin_v2/overlay/types/consistency.py b/google/cloud/bigtable/admin/overlay/types/consistency.py similarity index 87% rename from google/cloud/bigtable_admin_v2/overlay/types/consistency.py rename to google/cloud/bigtable/admin/overlay/types/consistency.py index 63a110975..51d543c1e 100644 --- a/google/cloud/bigtable_admin_v2/overlay/types/consistency.py +++ b/google/cloud/bigtable/admin/overlay/types/consistency.py @@ -17,7 +17,7 @@ from google.api_core.future import polling from google.api_core import gapic_v1 from google.api_core import retry as retries -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import bigtable_table_admin try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] @@ -34,17 +34,17 @@ class _CheckConsistencyPollingFuture(polling.PollingFuture): **This class should not be instantiated by users** and should only be instantiated by the admin client's - :meth:`google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_consistency` + :meth:`google.cloud.bigtable.admin.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_consistency` or - :meth:`google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_replication` + :meth:`google.cloud.bigtable.admin.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_replication` methods. Args: check_consistency_call(Callable[ [Optional[google.api_core.retry.Retry], - google.cloud.bigtable_admin_v2.types.CheckConsistencyResponse]): + google.cloud.bigtable.admin.types.CheckConsistencyResponse]): A :meth:`check_consistency - ` + ` call from the admin client. The call should fix every user parameter, which will be done via :meth:`functools.partial`. polling (google.api_core.retry.Retry): The configuration used for polling. diff --git a/google/cloud/bigtable_admin_v2/overlay/types/restore_table.py b/google/cloud/bigtable/admin/overlay/types/restore_table.py similarity index 93% rename from google/cloud/bigtable_admin_v2/overlay/types/restore_table.py rename to google/cloud/bigtable/admin/overlay/types/restore_table.py index 84c9c5d91..c029a3313 100644 --- a/google/cloud/bigtable_admin_v2/overlay/types/restore_table.py +++ b/google/cloud/bigtable/admin/overlay/types/restore_table.py @@ -18,7 +18,7 @@ from google.api_core import operation from google.protobuf import empty_pb2 -from google.cloud.bigtable_admin_v2.types import OptimizeRestoredTableMetadata +from google.cloud.bigtable.admin.types import OptimizeRestoredTableMetadata class RestoreTableOperation(operation.Operation): @@ -30,7 +30,7 @@ class RestoreTableOperation(operation.Operation): **This class should not be instantiated by users** and should only be instantiated by the admin client's :meth:`restore_table - ` + ` method. Args: @@ -62,7 +62,7 @@ def optimize_restored_table_operation(self) -> Optional[operation.Operation]: The follow-up operation has :attr:`metadata ` type :class:`OptimizeRestoredTableMetadata - ` + ` and no return value, but can be waited for with `result`. The current operation might not trigger a follow-up OptimizeRestoredTable operation, in which case, this diff --git a/google/cloud/bigtable_admin_v2/overlay/types/wait_for_consistency_request.py b/google/cloud/bigtable/admin/overlay/types/wait_for_consistency_request.py similarity index 85% rename from google/cloud/bigtable_admin_v2/overlay/types/wait_for_consistency_request.py rename to google/cloud/bigtable/admin/overlay/types/wait_for_consistency_request.py index 51070230a..c827f377d 100644 --- a/google/cloud/bigtable_admin_v2/overlay/types/wait_for_consistency_request.py +++ b/google/cloud/bigtable/admin/overlay/types/wait_for_consistency_request.py @@ -16,7 +16,7 @@ import proto -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import bigtable_table_admin __protobuf__ = proto.module( package="google.bigtable.admin.v2", @@ -34,8 +34,8 @@ # for an autogenerated call. class WaitForConsistencyRequest(proto.Message): """Wrapper class for encapsulating parameters for the `wait_for_consistency` method in both - :class:`google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.client.BigtableTableAdminClient` - and :class:`google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.async_client.BigtableTableAdmiAsyncClient`. + :class:`google.cloud.bigtable.admin.overlay.services.bigtable_table_admin.client.BigtableTableAdminClient` + and :class:`google.cloud.bigtable.admin.overlay.services.bigtable_table_admin.async_client.BigtableTableAdmiAsyncClient`. This message has `oneof`_ fields (mutually exclusive fields). @@ -50,14 +50,14 @@ class WaitForConsistencyRequest(proto.Message): Required. The unique name of the Table for which to check replication consistency. Values are of the form ``projects/{project}/instances/{instance}/tables/{table}``. - standard_read_remote_writes (google.cloud.bigtable_admin_v2.types.StandardReadRemoteWrites): + standard_read_remote_writes (google.cloud.bigtable.admin.types.StandardReadRemoteWrites): Checks that reads using an app profile with ``StandardIsolation`` can see all writes committed before the token was created, even if the read and write target different clusters. This field is a member of `oneof`_ ``mode``. - data_boost_read_local_writes (google.cloud.bigtable_admin_v2.types.DataBoostReadLocalWrites): + data_boost_read_local_writes (google.cloud.bigtable.admin.types.DataBoostReadLocalWrites): Checks that reads using an app profile with ``DataBoostIsolationReadOnly`` can see all writes committed before the token was created, but only if the read and write diff --git a/google/cloud/bigtable_admin/py.typed b/google/cloud/bigtable/admin/py.typed similarity index 100% rename from google/cloud/bigtable_admin/py.typed rename to google/cloud/bigtable/admin/py.typed diff --git a/google/cloud/bigtable_admin_v2/services/__init__.py b/google/cloud/bigtable/admin/services/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/services/__init__.py rename to google/cloud/bigtable/admin/services/__init__.py diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/__init__.py b/google/cloud/bigtable/admin/services/bigtable_instance_admin/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/__init__.py rename to google/cloud/bigtable/admin/services/bigtable_instance_admin/__init__.py diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py b/google/cloud/bigtable/admin/services/bigtable_instance_admin/async_client.py similarity index 91% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py rename to google/cloud/bigtable/admin/services/bigtable_instance_admin/async_client.py index a1aee2370..fe6a94214 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py +++ b/google/cloud/bigtable/admin/services/bigtable_instance_admin/async_client.py @@ -29,7 +29,7 @@ Union, ) -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -47,11 +47,11 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import pagers -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import common -from google.cloud.bigtable_admin_v2.types import instance -from google.cloud.bigtable_admin_v2.types import instance as gba_instance +from google.cloud.bigtable.admin.services.bigtable_instance_admin import pagers +from google.cloud.bigtable.admin.types import bigtable_instance_admin +from google.cloud.bigtable.admin.types import common +from google.cloud.bigtable.admin.types import instance +from google.cloud.bigtable.admin.types import instance as gba_instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -314,7 +314,7 @@ def __init__( std_logging.DEBUG ): # pragma: NO COVER _LOGGER.debug( - "Created client `google.bigtable.admin_v2.BigtableInstanceAdminAsyncClient`.", + "Created client `google.bigtable.admin.BigtableInstanceAdminAsyncClient`.", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "universeDomain": getattr( @@ -363,17 +363,17 @@ async def create_instance( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_create_instance(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - instance = bigtable_admin_v2.Instance() + instance = admin.Instance() instance.display_name = "display_name_value" - request = bigtable_admin_v2.CreateInstanceRequest( + request = admin.CreateInstanceRequest( parent="parent_value", instance_id="instance_id_value", instance=instance, @@ -390,7 +390,7 @@ async def sample_create_instance(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateInstanceRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.CreateInstanceRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.CreateInstance. parent (:class:`str`): @@ -409,14 +409,14 @@ async def sample_create_instance(): This corresponds to the ``instance_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - instance (:class:`google.cloud.bigtable_admin_v2.types.Instance`): + instance (:class:`google.cloud.bigtable.admin.types.Instance`): Required. The instance to create. Fields marked ``OutputOnly`` must be left blank. This corresponds to the ``instance`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - clusters (:class:`MutableMapping[str, google.cloud.bigtable_admin_v2.types.Cluster]`): + clusters (:class:`MutableMapping[str, google.cloud.bigtable.admin.types.Cluster]`): Required. The clusters to be created within the instance, mapped by desired cluster ID, e.g., just ``mycluster`` rather than @@ -438,7 +438,7 @@ async def sample_create_instance(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all [Clusters][google.bigtable.admin.v2.Cluster] in the @@ -531,14 +531,14 @@ async def get_instance( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_get_instance(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetInstanceRequest( + request = admin.GetInstanceRequest( name="name_value", ) @@ -549,7 +549,7 @@ async def sample_get_instance(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetInstanceRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.GetInstanceRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.GetInstance. name (:class:`str`): @@ -569,7 +569,7 @@ async def sample_get_instance(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Instance: + google.cloud.bigtable.admin.types.Instance: A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all @@ -648,14 +648,14 @@ async def list_instances( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_list_instances(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListInstancesRequest( + request = admin.ListInstancesRequest( parent="parent_value", ) @@ -666,7 +666,7 @@ async def sample_list_instances(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListInstancesRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.ListInstancesRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.ListInstances. parent (:class:`str`): @@ -686,7 +686,7 @@ async def sample_list_instances(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.ListInstancesResponse: + google.cloud.bigtable.admin.types.ListInstancesResponse: Response message for BigtableInstanceAdmin.ListInstances. @@ -762,14 +762,14 @@ async def update_instance( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_update_instance(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.Instance( + request = admin.Instance( display_name="display_name_value", ) @@ -780,7 +780,7 @@ async def sample_update_instance(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.Instance, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.Instance, dict]]): The request object. A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are @@ -796,7 +796,7 @@ async def sample_update_instance(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Instance: + google.cloud.bigtable.admin.types.Instance: A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all @@ -861,17 +861,17 @@ async def partial_update_instance( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_partial_update_instance(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - instance = bigtable_admin_v2.Instance() + instance = admin.Instance() instance.display_name = "display_name_value" - request = bigtable_admin_v2.PartialUpdateInstanceRequest( + request = admin.PartialUpdateInstanceRequest( instance=instance, ) @@ -886,10 +886,10 @@ async def sample_partial_update_instance(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.PartialUpdateInstanceRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.PartialUpdateInstanceRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.PartialUpdateInstance. - instance (:class:`google.cloud.bigtable_admin_v2.types.Instance`): + instance (:class:`google.cloud.bigtable.admin.types.Instance`): Required. The Instance which will (partially) replace the current value. @@ -916,7 +916,7 @@ async def sample_partial_update_instance(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all [Clusters][google.bigtable.admin.v2.Cluster] in the @@ -1008,14 +1008,14 @@ async def delete_instance( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_delete_instance(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteInstanceRequest( + request = admin.DeleteInstanceRequest( name="name_value", ) @@ -1023,7 +1023,7 @@ async def sample_delete_instance(): await client.delete_instance(request=request) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteInstanceRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.DeleteInstanceRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.DeleteInstance. name (:class:`str`): @@ -1118,14 +1118,14 @@ async def create_cluster( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_create_cluster(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.CreateClusterRequest( + request = admin.CreateClusterRequest( parent="parent_value", cluster_id="cluster_id_value", ) @@ -1141,7 +1141,7 @@ async def sample_create_cluster(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateClusterRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.CreateClusterRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.CreateCluster. parent (:class:`str`): @@ -1161,7 +1161,7 @@ async def sample_create_cluster(): This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster (:class:`google.cloud.bigtable_admin_v2.types.Cluster`): + cluster (:class:`google.cloud.bigtable.admin.types.Cluster`): Required. The cluster to be created. Fields marked ``OutputOnly`` must be left blank. @@ -1180,7 +1180,7 @@ async def sample_create_cluster(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Cluster` A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent [Instance][google.bigtable.admin.v2.Instance]. @@ -1269,14 +1269,14 @@ async def get_cluster( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_get_cluster(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetClusterRequest( + request = admin.GetClusterRequest( name="name_value", ) @@ -1287,7 +1287,7 @@ async def sample_get_cluster(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetClusterRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.GetClusterRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.GetCluster. name (:class:`str`): @@ -1307,7 +1307,7 @@ async def sample_get_cluster(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Cluster: + google.cloud.bigtable.admin.types.Cluster: A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the @@ -1385,14 +1385,14 @@ async def list_clusters( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_list_clusters(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListClustersRequest( + request = admin.ListClustersRequest( parent="parent_value", ) @@ -1403,7 +1403,7 @@ async def sample_list_clusters(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListClustersRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.ListClustersRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.ListClusters. parent (:class:`str`): @@ -1425,7 +1425,7 @@ async def sample_list_clusters(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.ListClustersResponse: + google.cloud.bigtable.admin.types.ListClustersResponse: Response message for BigtableInstanceAdmin.ListClusters. @@ -1502,14 +1502,14 @@ async def update_cluster( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_update_cluster(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.Cluster( + request = admin.Cluster( ) # Make the request @@ -1523,7 +1523,7 @@ async def sample_update_cluster(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.Cluster, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.Cluster, dict]]): The request object. A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent @@ -1540,7 +1540,7 @@ async def sample_update_cluster(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Cluster` A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent [Instance][google.bigtable.admin.v2.Instance]. @@ -1622,14 +1622,14 @@ async def partial_update_cluster( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_partial_update_cluster(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.PartialUpdateClusterRequest( + request = admin.PartialUpdateClusterRequest( ) # Make the request @@ -1643,10 +1643,10 @@ async def sample_partial_update_cluster(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.PartialUpdateClusterRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.PartialUpdateClusterRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.PartialUpdateCluster. - cluster (:class:`google.cloud.bigtable_admin_v2.types.Cluster`): + cluster (:class:`google.cloud.bigtable.admin.types.Cluster`): Required. The Cluster which contains the partial updates to be applied, subject to the update_mask. @@ -1672,7 +1672,7 @@ async def sample_partial_update_cluster(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Cluster` A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent [Instance][google.bigtable.admin.v2.Instance]. @@ -1761,14 +1761,14 @@ async def delete_cluster( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_delete_cluster(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteClusterRequest( + request = admin.DeleteClusterRequest( name="name_value", ) @@ -1776,7 +1776,7 @@ async def sample_delete_cluster(): await client.delete_cluster(request=request) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteClusterRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.DeleteClusterRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.DeleteCluster. name (:class:`str`): @@ -1865,17 +1865,17 @@ async def create_app_profile( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_create_app_profile(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - app_profile = bigtable_admin_v2.AppProfile() + app_profile = admin.AppProfile() app_profile.priority = "PRIORITY_HIGH" - request = bigtable_admin_v2.CreateAppProfileRequest( + request = admin.CreateAppProfileRequest( parent="parent_value", app_profile_id="app_profile_id_value", app_profile=app_profile, @@ -1888,7 +1888,7 @@ async def sample_create_app_profile(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateAppProfileRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.CreateAppProfileRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.CreateAppProfile. parent (:class:`str`): @@ -1908,7 +1908,7 @@ async def sample_create_app_profile(): This corresponds to the ``app_profile_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - app_profile (:class:`google.cloud.bigtable_admin_v2.types.AppProfile`): + app_profile (:class:`google.cloud.bigtable.admin.types.AppProfile`): Required. The app profile to be created. Fields marked ``OutputOnly`` will be ignored. @@ -1924,7 +1924,7 @@ async def sample_create_app_profile(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.AppProfile: + google.cloud.bigtable.admin.types.AppProfile: A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. @@ -2005,14 +2005,14 @@ async def get_app_profile( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_get_app_profile(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetAppProfileRequest( + request = admin.GetAppProfileRequest( name="name_value", ) @@ -2023,7 +2023,7 @@ async def sample_get_app_profile(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetAppProfileRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.GetAppProfileRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.GetAppProfile. name (:class:`str`): @@ -2043,7 +2043,7 @@ async def sample_get_app_profile(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.AppProfile: + google.cloud.bigtable.admin.types.AppProfile: A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. @@ -2120,14 +2120,14 @@ async def list_app_profiles( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_list_app_profiles(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListAppProfilesRequest( + request = admin.ListAppProfilesRequest( parent="parent_value", ) @@ -2139,7 +2139,7 @@ async def sample_list_app_profiles(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListAppProfilesRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.ListAppProfilesRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.ListAppProfiles. parent (:class:`str`): @@ -2162,7 +2162,7 @@ async def sample_list_app_profiles(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListAppProfilesAsyncPager: + google.cloud.bigtable.admin.services.bigtable_instance_admin.pagers.ListAppProfilesAsyncPager: Response message for BigtableInstanceAdmin.ListAppProfiles. Iterating over this object will yield @@ -2253,17 +2253,17 @@ async def update_app_profile( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_update_app_profile(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - app_profile = bigtable_admin_v2.AppProfile() + app_profile = admin.AppProfile() app_profile.priority = "PRIORITY_HIGH" - request = bigtable_admin_v2.UpdateAppProfileRequest( + request = admin.UpdateAppProfileRequest( app_profile=app_profile, ) @@ -2278,10 +2278,10 @@ async def sample_update_app_profile(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateAppProfileRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.UpdateAppProfileRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.UpdateAppProfile. - app_profile (:class:`google.cloud.bigtable_admin_v2.types.AppProfile`): + app_profile (:class:`google.cloud.bigtable.admin.types.AppProfile`): Required. The app profile which will (partially) replace the current value. @@ -2308,7 +2308,7 @@ async def sample_update_app_profile(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.AppProfile` A configuration object describing how Cloud Bigtable should treat traffic + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.AppProfile` A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. """ @@ -2396,14 +2396,14 @@ async def delete_app_profile( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_delete_app_profile(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteAppProfileRequest( + request = admin.DeleteAppProfileRequest( name="name_value", ignore_warnings=True, ) @@ -2412,7 +2412,7 @@ async def sample_delete_app_profile(): await client.delete_app_profile(request=request) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteAppProfileRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.DeleteAppProfileRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.DeleteAppProfile. name (:class:`str`): @@ -2508,12 +2508,12 @@ async def get_iam_policy( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_get_iam_policy(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -2565,19 +2565,19 @@ async def sample_get_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -2647,12 +2647,12 @@ async def set_iam_policy( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_set_iam_policy(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -2704,19 +2704,19 @@ async def sample_set_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -2787,12 +2787,12 @@ async def test_iam_permissions( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_test_iam_permissions(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -2910,14 +2910,14 @@ async def list_hot_tablets( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_list_hot_tablets(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListHotTabletsRequest( + request = admin.ListHotTabletsRequest( parent="parent_value", ) @@ -2929,7 +2929,7 @@ async def sample_list_hot_tablets(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListHotTabletsRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.ListHotTabletsRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.ListHotTablets. parent (:class:`str`): @@ -2949,7 +2949,7 @@ async def sample_list_hot_tablets(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListHotTabletsAsyncPager: + google.cloud.bigtable.admin.services.bigtable_instance_admin.pagers.ListHotTabletsAsyncPager: Response message for BigtableInstanceAdmin.ListHotTablets. Iterating over this object will yield @@ -3041,17 +3041,17 @@ async def create_logical_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_create_logical_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - logical_view = bigtable_admin_v2.LogicalView() + logical_view = admin.LogicalView() logical_view.query = "query_value" - request = bigtable_admin_v2.CreateLogicalViewRequest( + request = admin.CreateLogicalViewRequest( parent="parent_value", logical_view_id="logical_view_id_value", logical_view=logical_view, @@ -3068,7 +3068,7 @@ async def sample_create_logical_view(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateLogicalViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.CreateLogicalViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.CreateLogicalView. parent (:class:`str`): @@ -3079,7 +3079,7 @@ async def sample_create_logical_view(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - logical_view (:class:`google.cloud.bigtable_admin_v2.types.LogicalView`): + logical_view (:class:`google.cloud.bigtable.admin.types.LogicalView`): Required. The logical view to create. This corresponds to the ``logical_view`` field on the ``request`` instance; if ``request`` is provided, this @@ -3106,7 +3106,7 @@ async def sample_create_logical_view(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.LogicalView` + :class:`google.cloud.bigtable.admin.types.LogicalView` A SQL logical view object that can be referenced in SQL queries. @@ -3194,14 +3194,14 @@ async def get_logical_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_get_logical_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetLogicalViewRequest( + request = admin.GetLogicalViewRequest( name="name_value", ) @@ -3212,7 +3212,7 @@ async def sample_get_logical_view(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetLogicalViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.GetLogicalViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.GetLogicalView. name (:class:`str`): @@ -3232,7 +3232,7 @@ async def sample_get_logical_view(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.LogicalView: + google.cloud.bigtable.admin.types.LogicalView: A SQL logical view object that can be referenced in SQL queries. @@ -3308,14 +3308,14 @@ async def list_logical_views( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_list_logical_views(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListLogicalViewsRequest( + request = admin.ListLogicalViewsRequest( parent="parent_value", ) @@ -3327,7 +3327,7 @@ async def sample_list_logical_views(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListLogicalViewsRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.ListLogicalViewsRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.ListLogicalViews. parent (:class:`str`): @@ -3347,7 +3347,7 @@ async def sample_list_logical_views(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListLogicalViewsAsyncPager: + google.cloud.bigtable.admin.services.bigtable_instance_admin.pagers.ListLogicalViewsAsyncPager: Response message for BigtableInstanceAdmin.ListLogicalViews. Iterating over this object will yield @@ -3438,17 +3438,17 @@ async def update_logical_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_update_logical_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - logical_view = bigtable_admin_v2.LogicalView() + logical_view = admin.LogicalView() logical_view.query = "query_value" - request = bigtable_admin_v2.UpdateLogicalViewRequest( + request = admin.UpdateLogicalViewRequest( logical_view=logical_view, ) @@ -3463,10 +3463,10 @@ async def sample_update_logical_view(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateLogicalViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.UpdateLogicalViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.UpdateLogicalView. - logical_view (:class:`google.cloud.bigtable_admin_v2.types.LogicalView`): + logical_view (:class:`google.cloud.bigtable.admin.types.LogicalView`): Required. The logical view to update. The logical view's ``name`` field is used to identify @@ -3496,7 +3496,7 @@ async def sample_update_logical_view(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.LogicalView` + :class:`google.cloud.bigtable.admin.types.LogicalView` A SQL logical view object that can be referenced in SQL queries. @@ -3584,14 +3584,14 @@ async def delete_logical_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_delete_logical_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteLogicalViewRequest( + request = admin.DeleteLogicalViewRequest( name="name_value", ) @@ -3599,7 +3599,7 @@ async def sample_delete_logical_view(): await client.delete_logical_view(request=request) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteLogicalViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.DeleteLogicalViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.DeleteLogicalView. name (:class:`str`): @@ -3688,17 +3688,17 @@ async def create_materialized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_create_materialized_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - materialized_view = bigtable_admin_v2.MaterializedView() + materialized_view = admin.MaterializedView() materialized_view.query = "query_value" - request = bigtable_admin_v2.CreateMaterializedViewRequest( + request = admin.CreateMaterializedViewRequest( parent="parent_value", materialized_view_id="materialized_view_id_value", materialized_view=materialized_view, @@ -3715,7 +3715,7 @@ async def sample_create_materialized_view(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateMaterializedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.CreateMaterializedViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.CreateMaterializedView. parent (:class:`str`): @@ -3726,7 +3726,7 @@ async def sample_create_materialized_view(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - materialized_view (:class:`google.cloud.bigtable_admin_v2.types.MaterializedView`): + materialized_view (:class:`google.cloud.bigtable.admin.types.MaterializedView`): Required. The materialized view to create. @@ -3755,7 +3755,7 @@ async def sample_create_materialized_view(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.MaterializedView` + :class:`google.cloud.bigtable.admin.types.MaterializedView` A materialized view object that can be referenced in SQL queries. @@ -3845,14 +3845,14 @@ async def get_materialized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_get_materialized_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetMaterializedViewRequest( + request = admin.GetMaterializedViewRequest( name="name_value", ) @@ -3863,7 +3863,7 @@ async def sample_get_materialized_view(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetMaterializedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.GetMaterializedViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.GetMaterializedView. name (:class:`str`): @@ -3883,7 +3883,7 @@ async def sample_get_materialized_view(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.MaterializedView: + google.cloud.bigtable.admin.types.MaterializedView: A materialized view object that can be referenced in SQL queries. @@ -3960,14 +3960,14 @@ async def list_materialized_views( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_list_materialized_views(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListMaterializedViewsRequest( + request = admin.ListMaterializedViewsRequest( parent="parent_value", ) @@ -3979,7 +3979,7 @@ async def sample_list_materialized_views(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListMaterializedViewsRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.ListMaterializedViewsRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.ListMaterializedViews. parent (:class:`str`): @@ -3999,7 +3999,7 @@ async def sample_list_materialized_views(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListMaterializedViewsAsyncPager: + google.cloud.bigtable.admin.services.bigtable_instance_admin.pagers.ListMaterializedViewsAsyncPager: Response message for BigtableInstanceAdmin.ListMaterializedViews. Iterating over this object will yield @@ -4092,17 +4092,17 @@ async def update_materialized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_update_materialized_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - materialized_view = bigtable_admin_v2.MaterializedView() + materialized_view = admin.MaterializedView() materialized_view.query = "query_value" - request = bigtable_admin_v2.UpdateMaterializedViewRequest( + request = admin.UpdateMaterializedViewRequest( materialized_view=materialized_view, ) @@ -4117,10 +4117,10 @@ async def sample_update_materialized_view(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateMaterializedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.UpdateMaterializedViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.UpdateMaterializedView. - materialized_view (:class:`google.cloud.bigtable_admin_v2.types.MaterializedView`): + materialized_view (:class:`google.cloud.bigtable.admin.types.MaterializedView`): Required. The materialized view to update. The materialized view's ``name`` field is used to @@ -4150,7 +4150,7 @@ async def sample_update_materialized_view(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.MaterializedView` + :class:`google.cloud.bigtable.admin.types.MaterializedView` A materialized view object that can be referenced in SQL queries. @@ -4240,14 +4240,14 @@ async def delete_materialized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_delete_materialized_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient() + client = admin.BigtableInstanceAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteMaterializedViewRequest( + request = admin.DeleteMaterializedViewRequest( name="name_value", ) @@ -4255,7 +4255,7 @@ async def sample_delete_materialized_view(): await client.delete_materialized_view(request=request) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteMaterializedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.DeleteMaterializedViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.DeleteMaterializedView. name (:class:`str`): diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py b/google/cloud/bigtable/admin/services/bigtable_instance_admin/client.py similarity index 92% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py rename to google/cloud/bigtable/admin/services/bigtable_instance_admin/client.py index 84df01058..dc6e479f0 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py +++ b/google/cloud/bigtable/admin/services/bigtable_instance_admin/client.py @@ -34,7 +34,7 @@ ) import warnings -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -63,11 +63,11 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import pagers -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import common -from google.cloud.bigtable_admin_v2.types import instance -from google.cloud.bigtable_admin_v2.types import instance as gba_instance +from google.cloud.bigtable.admin.services.bigtable_instance_admin import pagers +from google.cloud.bigtable.admin.types import bigtable_instance_admin +from google.cloud.bigtable.admin.types import common +from google.cloud.bigtable.admin.types import instance +from google.cloud.bigtable.admin.types import instance as gba_instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -866,7 +866,7 @@ def __init__( std_logging.DEBUG ): # pragma: NO COVER _LOGGER.debug( - "Created client `google.bigtable.admin_v2.BigtableInstanceAdminClient`.", + "Created client `google.bigtable.admin.BigtableInstanceAdminClient`.", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "universeDomain": getattr( @@ -915,17 +915,17 @@ def create_instance( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_create_instance(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - instance = bigtable_admin_v2.Instance() + instance = admin.Instance() instance.display_name = "display_name_value" - request = bigtable_admin_v2.CreateInstanceRequest( + request = admin.CreateInstanceRequest( parent="parent_value", instance_id="instance_id_value", instance=instance, @@ -942,7 +942,7 @@ def sample_create_instance(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateInstanceRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.CreateInstanceRequest, dict]): The request object. Request message for BigtableInstanceAdmin.CreateInstance. parent (str): @@ -961,14 +961,14 @@ def sample_create_instance(): This corresponds to the ``instance_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - instance (google.cloud.bigtable_admin_v2.types.Instance): + instance (google.cloud.bigtable.admin.types.Instance): Required. The instance to create. Fields marked ``OutputOnly`` must be left blank. This corresponds to the ``instance`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - clusters (MutableMapping[str, google.cloud.bigtable_admin_v2.types.Cluster]): + clusters (MutableMapping[str, google.cloud.bigtable.admin.types.Cluster]): Required. The clusters to be created within the instance, mapped by desired cluster ID, e.g., just ``mycluster`` rather than @@ -990,7 +990,7 @@ def sample_create_instance(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all [Clusters][google.bigtable.admin.v2.Cluster] in the @@ -1079,14 +1079,14 @@ def get_instance( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_get_instance(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetInstanceRequest( + request = admin.GetInstanceRequest( name="name_value", ) @@ -1097,7 +1097,7 @@ def sample_get_instance(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetInstanceRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.GetInstanceRequest, dict]): The request object. Request message for BigtableInstanceAdmin.GetInstance. name (str): @@ -1117,7 +1117,7 @@ def sample_get_instance(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Instance: + google.cloud.bigtable.admin.types.Instance: A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all @@ -1193,14 +1193,14 @@ def list_instances( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_list_instances(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListInstancesRequest( + request = admin.ListInstancesRequest( parent="parent_value", ) @@ -1211,7 +1211,7 @@ def sample_list_instances(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListInstancesRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.ListInstancesRequest, dict]): The request object. Request message for BigtableInstanceAdmin.ListInstances. parent (str): @@ -1231,7 +1231,7 @@ def sample_list_instances(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.ListInstancesResponse: + google.cloud.bigtable.admin.types.ListInstancesResponse: Response message for BigtableInstanceAdmin.ListInstances. @@ -1304,14 +1304,14 @@ def update_instance( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_update_instance(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.Instance( + request = admin.Instance( display_name="display_name_value", ) @@ -1322,7 +1322,7 @@ def sample_update_instance(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.Instance, dict]): + request (Union[google.cloud.bigtable.admin.types.Instance, dict]): The request object. A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are @@ -1338,7 +1338,7 @@ def sample_update_instance(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Instance: + google.cloud.bigtable.admin.types.Instance: A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all @@ -1401,17 +1401,17 @@ def partial_update_instance( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_partial_update_instance(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - instance = bigtable_admin_v2.Instance() + instance = admin.Instance() instance.display_name = "display_name_value" - request = bigtable_admin_v2.PartialUpdateInstanceRequest( + request = admin.PartialUpdateInstanceRequest( instance=instance, ) @@ -1426,10 +1426,10 @@ def sample_partial_update_instance(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.PartialUpdateInstanceRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.PartialUpdateInstanceRequest, dict]): The request object. Request message for BigtableInstanceAdmin.PartialUpdateInstance. - instance (google.cloud.bigtable_admin_v2.types.Instance): + instance (google.cloud.bigtable.admin.types.Instance): Required. The Instance which will (partially) replace the current value. @@ -1456,7 +1456,7 @@ def sample_partial_update_instance(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all [Clusters][google.bigtable.admin.v2.Cluster] in the @@ -1545,14 +1545,14 @@ def delete_instance( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_delete_instance(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteInstanceRequest( + request = admin.DeleteInstanceRequest( name="name_value", ) @@ -1560,7 +1560,7 @@ def sample_delete_instance(): client.delete_instance(request=request) Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteInstanceRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.DeleteInstanceRequest, dict]): The request object. Request message for BigtableInstanceAdmin.DeleteInstance. name (str): @@ -1652,14 +1652,14 @@ def create_cluster( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_create_cluster(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.CreateClusterRequest( + request = admin.CreateClusterRequest( parent="parent_value", cluster_id="cluster_id_value", ) @@ -1675,7 +1675,7 @@ def sample_create_cluster(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateClusterRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.CreateClusterRequest, dict]): The request object. Request message for BigtableInstanceAdmin.CreateCluster. parent (str): @@ -1695,7 +1695,7 @@ def sample_create_cluster(): This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster (google.cloud.bigtable_admin_v2.types.Cluster): + cluster (google.cloud.bigtable.admin.types.Cluster): Required. The cluster to be created. Fields marked ``OutputOnly`` must be left blank. @@ -1714,7 +1714,7 @@ def sample_create_cluster(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Cluster` A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent [Instance][google.bigtable.admin.v2.Instance]. @@ -1800,14 +1800,14 @@ def get_cluster( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_get_cluster(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetClusterRequest( + request = admin.GetClusterRequest( name="name_value", ) @@ -1818,7 +1818,7 @@ def sample_get_cluster(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetClusterRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.GetClusterRequest, dict]): The request object. Request message for BigtableInstanceAdmin.GetCluster. name (str): @@ -1838,7 +1838,7 @@ def sample_get_cluster(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Cluster: + google.cloud.bigtable.admin.types.Cluster: A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the @@ -1913,14 +1913,14 @@ def list_clusters( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_list_clusters(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListClustersRequest( + request = admin.ListClustersRequest( parent="parent_value", ) @@ -1931,7 +1931,7 @@ def sample_list_clusters(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListClustersRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.ListClustersRequest, dict]): The request object. Request message for BigtableInstanceAdmin.ListClusters. parent (str): @@ -1953,7 +1953,7 @@ def sample_list_clusters(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.ListClustersResponse: + google.cloud.bigtable.admin.types.ListClustersResponse: Response message for BigtableInstanceAdmin.ListClusters. @@ -2027,14 +2027,14 @@ def update_cluster( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_update_cluster(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.Cluster( + request = admin.Cluster( ) # Make the request @@ -2048,7 +2048,7 @@ def sample_update_cluster(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.Cluster, dict]): + request (Union[google.cloud.bigtable.admin.types.Cluster, dict]): The request object. A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent @@ -2065,7 +2065,7 @@ def sample_update_cluster(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Cluster` A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent [Instance][google.bigtable.admin.v2.Instance]. @@ -2145,14 +2145,14 @@ def partial_update_cluster( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_partial_update_cluster(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.PartialUpdateClusterRequest( + request = admin.PartialUpdateClusterRequest( ) # Make the request @@ -2166,10 +2166,10 @@ def sample_partial_update_cluster(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.PartialUpdateClusterRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.PartialUpdateClusterRequest, dict]): The request object. Request message for BigtableInstanceAdmin.PartialUpdateCluster. - cluster (google.cloud.bigtable_admin_v2.types.Cluster): + cluster (google.cloud.bigtable.admin.types.Cluster): Required. The Cluster which contains the partial updates to be applied, subject to the update_mask. @@ -2195,7 +2195,7 @@ def sample_partial_update_cluster(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Cluster` A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent [Instance][google.bigtable.admin.v2.Instance]. @@ -2281,14 +2281,14 @@ def delete_cluster( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_delete_cluster(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteClusterRequest( + request = admin.DeleteClusterRequest( name="name_value", ) @@ -2296,7 +2296,7 @@ def sample_delete_cluster(): client.delete_cluster(request=request) Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteClusterRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.DeleteClusterRequest, dict]): The request object. Request message for BigtableInstanceAdmin.DeleteCluster. name (str): @@ -2382,17 +2382,17 @@ def create_app_profile( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_create_app_profile(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - app_profile = bigtable_admin_v2.AppProfile() + app_profile = admin.AppProfile() app_profile.priority = "PRIORITY_HIGH" - request = bigtable_admin_v2.CreateAppProfileRequest( + request = admin.CreateAppProfileRequest( parent="parent_value", app_profile_id="app_profile_id_value", app_profile=app_profile, @@ -2405,7 +2405,7 @@ def sample_create_app_profile(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateAppProfileRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.CreateAppProfileRequest, dict]): The request object. Request message for BigtableInstanceAdmin.CreateAppProfile. parent (str): @@ -2425,7 +2425,7 @@ def sample_create_app_profile(): This corresponds to the ``app_profile_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - app_profile (google.cloud.bigtable_admin_v2.types.AppProfile): + app_profile (google.cloud.bigtable.admin.types.AppProfile): Required. The app profile to be created. Fields marked ``OutputOnly`` will be ignored. @@ -2441,7 +2441,7 @@ def sample_create_app_profile(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.AppProfile: + google.cloud.bigtable.admin.types.AppProfile: A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. @@ -2519,14 +2519,14 @@ def get_app_profile( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_get_app_profile(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetAppProfileRequest( + request = admin.GetAppProfileRequest( name="name_value", ) @@ -2537,7 +2537,7 @@ def sample_get_app_profile(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetAppProfileRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.GetAppProfileRequest, dict]): The request object. Request message for BigtableInstanceAdmin.GetAppProfile. name (str): @@ -2557,7 +2557,7 @@ def sample_get_app_profile(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.AppProfile: + google.cloud.bigtable.admin.types.AppProfile: A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. @@ -2631,14 +2631,14 @@ def list_app_profiles( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_list_app_profiles(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListAppProfilesRequest( + request = admin.ListAppProfilesRequest( parent="parent_value", ) @@ -2650,7 +2650,7 @@ def sample_list_app_profiles(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListAppProfilesRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.ListAppProfilesRequest, dict]): The request object. Request message for BigtableInstanceAdmin.ListAppProfiles. parent (str): @@ -2673,7 +2673,7 @@ def sample_list_app_profiles(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListAppProfilesPager: + google.cloud.bigtable.admin.services.bigtable_instance_admin.pagers.ListAppProfilesPager: Response message for BigtableInstanceAdmin.ListAppProfiles. Iterating over this object will yield @@ -2761,17 +2761,17 @@ def update_app_profile( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_update_app_profile(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - app_profile = bigtable_admin_v2.AppProfile() + app_profile = admin.AppProfile() app_profile.priority = "PRIORITY_HIGH" - request = bigtable_admin_v2.UpdateAppProfileRequest( + request = admin.UpdateAppProfileRequest( app_profile=app_profile, ) @@ -2786,10 +2786,10 @@ def sample_update_app_profile(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateAppProfileRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.UpdateAppProfileRequest, dict]): The request object. Request message for BigtableInstanceAdmin.UpdateAppProfile. - app_profile (google.cloud.bigtable_admin_v2.types.AppProfile): + app_profile (google.cloud.bigtable.admin.types.AppProfile): Required. The app profile which will (partially) replace the current value. @@ -2816,7 +2816,7 @@ def sample_update_app_profile(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.AppProfile` A configuration object describing how Cloud Bigtable should treat traffic + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.AppProfile` A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. """ @@ -2901,14 +2901,14 @@ def delete_app_profile( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_delete_app_profile(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteAppProfileRequest( + request = admin.DeleteAppProfileRequest( name="name_value", ignore_warnings=True, ) @@ -2917,7 +2917,7 @@ def sample_delete_app_profile(): client.delete_app_profile(request=request) Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteAppProfileRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.DeleteAppProfileRequest, dict]): The request object. Request message for BigtableInstanceAdmin.DeleteAppProfile. name (str): @@ -3010,12 +3010,12 @@ def get_iam_policy( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -3067,19 +3067,19 @@ def sample_get_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -3150,12 +3150,12 @@ def set_iam_policy( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -3207,19 +3207,19 @@ def sample_set_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -3291,12 +3291,12 @@ def test_iam_permissions( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -3415,14 +3415,14 @@ def list_hot_tablets( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_list_hot_tablets(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListHotTabletsRequest( + request = admin.ListHotTabletsRequest( parent="parent_value", ) @@ -3434,7 +3434,7 @@ def sample_list_hot_tablets(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListHotTabletsRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.ListHotTabletsRequest, dict]): The request object. Request message for BigtableInstanceAdmin.ListHotTablets. parent (str): @@ -3454,7 +3454,7 @@ def sample_list_hot_tablets(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListHotTabletsPager: + google.cloud.bigtable.admin.services.bigtable_instance_admin.pagers.ListHotTabletsPager: Response message for BigtableInstanceAdmin.ListHotTablets. Iterating over this object will yield @@ -3543,17 +3543,17 @@ def create_logical_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_create_logical_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - logical_view = bigtable_admin_v2.LogicalView() + logical_view = admin.LogicalView() logical_view.query = "query_value" - request = bigtable_admin_v2.CreateLogicalViewRequest( + request = admin.CreateLogicalViewRequest( parent="parent_value", logical_view_id="logical_view_id_value", logical_view=logical_view, @@ -3570,7 +3570,7 @@ def sample_create_logical_view(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateLogicalViewRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.CreateLogicalViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.CreateLogicalView. parent (str): @@ -3581,7 +3581,7 @@ def sample_create_logical_view(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - logical_view (google.cloud.bigtable_admin_v2.types.LogicalView): + logical_view (google.cloud.bigtable.admin.types.LogicalView): Required. The logical view to create. This corresponds to the ``logical_view`` field on the ``request`` instance; if ``request`` is provided, this @@ -3608,7 +3608,7 @@ def sample_create_logical_view(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.LogicalView` + :class:`google.cloud.bigtable.admin.types.LogicalView` A SQL logical view object that can be referenced in SQL queries. @@ -3693,14 +3693,14 @@ def get_logical_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_get_logical_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetLogicalViewRequest( + request = admin.GetLogicalViewRequest( name="name_value", ) @@ -3711,7 +3711,7 @@ def sample_get_logical_view(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetLogicalViewRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.GetLogicalViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.GetLogicalView. name (str): @@ -3731,7 +3731,7 @@ def sample_get_logical_view(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.LogicalView: + google.cloud.bigtable.admin.types.LogicalView: A SQL logical view object that can be referenced in SQL queries. @@ -3804,14 +3804,14 @@ def list_logical_views( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_list_logical_views(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListLogicalViewsRequest( + request = admin.ListLogicalViewsRequest( parent="parent_value", ) @@ -3823,7 +3823,7 @@ def sample_list_logical_views(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListLogicalViewsRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.ListLogicalViewsRequest, dict]): The request object. Request message for BigtableInstanceAdmin.ListLogicalViews. parent (str): @@ -3843,7 +3843,7 @@ def sample_list_logical_views(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListLogicalViewsPager: + google.cloud.bigtable.admin.services.bigtable_instance_admin.pagers.ListLogicalViewsPager: Response message for BigtableInstanceAdmin.ListLogicalViews. Iterating over this object will yield @@ -3931,17 +3931,17 @@ def update_logical_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_update_logical_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - logical_view = bigtable_admin_v2.LogicalView() + logical_view = admin.LogicalView() logical_view.query = "query_value" - request = bigtable_admin_v2.UpdateLogicalViewRequest( + request = admin.UpdateLogicalViewRequest( logical_view=logical_view, ) @@ -3956,10 +3956,10 @@ def sample_update_logical_view(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateLogicalViewRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.UpdateLogicalViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.UpdateLogicalView. - logical_view (google.cloud.bigtable_admin_v2.types.LogicalView): + logical_view (google.cloud.bigtable.admin.types.LogicalView): Required. The logical view to update. The logical view's ``name`` field is used to identify @@ -3989,7 +3989,7 @@ def sample_update_logical_view(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.LogicalView` + :class:`google.cloud.bigtable.admin.types.LogicalView` A SQL logical view object that can be referenced in SQL queries. @@ -4074,14 +4074,14 @@ def delete_logical_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_delete_logical_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteLogicalViewRequest( + request = admin.DeleteLogicalViewRequest( name="name_value", ) @@ -4089,7 +4089,7 @@ def sample_delete_logical_view(): client.delete_logical_view(request=request) Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteLogicalViewRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.DeleteLogicalViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.DeleteLogicalView. name (str): @@ -4175,17 +4175,17 @@ def create_materialized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_create_materialized_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - materialized_view = bigtable_admin_v2.MaterializedView() + materialized_view = admin.MaterializedView() materialized_view.query = "query_value" - request = bigtable_admin_v2.CreateMaterializedViewRequest( + request = admin.CreateMaterializedViewRequest( parent="parent_value", materialized_view_id="materialized_view_id_value", materialized_view=materialized_view, @@ -4202,7 +4202,7 @@ def sample_create_materialized_view(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateMaterializedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.CreateMaterializedViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.CreateMaterializedView. parent (str): @@ -4213,7 +4213,7 @@ def sample_create_materialized_view(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - materialized_view (google.cloud.bigtable_admin_v2.types.MaterializedView): + materialized_view (google.cloud.bigtable.admin.types.MaterializedView): Required. The materialized view to create. @@ -4242,7 +4242,7 @@ def sample_create_materialized_view(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.MaterializedView` + :class:`google.cloud.bigtable.admin.types.MaterializedView` A materialized view object that can be referenced in SQL queries. @@ -4329,14 +4329,14 @@ def get_materialized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_get_materialized_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetMaterializedViewRequest( + request = admin.GetMaterializedViewRequest( name="name_value", ) @@ -4347,7 +4347,7 @@ def sample_get_materialized_view(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetMaterializedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.GetMaterializedViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.GetMaterializedView. name (str): @@ -4367,7 +4367,7 @@ def sample_get_materialized_view(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.MaterializedView: + google.cloud.bigtable.admin.types.MaterializedView: A materialized view object that can be referenced in SQL queries. @@ -4441,14 +4441,14 @@ def list_materialized_views( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_list_materialized_views(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListMaterializedViewsRequest( + request = admin.ListMaterializedViewsRequest( parent="parent_value", ) @@ -4460,7 +4460,7 @@ def sample_list_materialized_views(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListMaterializedViewsRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.ListMaterializedViewsRequest, dict]): The request object. Request message for BigtableInstanceAdmin.ListMaterializedViews. parent (str): @@ -4480,7 +4480,7 @@ def sample_list_materialized_views(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListMaterializedViewsPager: + google.cloud.bigtable.admin.services.bigtable_instance_admin.pagers.ListMaterializedViewsPager: Response message for BigtableInstanceAdmin.ListMaterializedViews. Iterating over this object will yield @@ -4570,17 +4570,17 @@ def update_materialized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_update_materialized_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - materialized_view = bigtable_admin_v2.MaterializedView() + materialized_view = admin.MaterializedView() materialized_view.query = "query_value" - request = bigtable_admin_v2.UpdateMaterializedViewRequest( + request = admin.UpdateMaterializedViewRequest( materialized_view=materialized_view, ) @@ -4595,10 +4595,10 @@ def sample_update_materialized_view(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateMaterializedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.UpdateMaterializedViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.UpdateMaterializedView. - materialized_view (google.cloud.bigtable_admin_v2.types.MaterializedView): + materialized_view (google.cloud.bigtable.admin.types.MaterializedView): Required. The materialized view to update. The materialized view's ``name`` field is used to @@ -4628,7 +4628,7 @@ def sample_update_materialized_view(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.MaterializedView` + :class:`google.cloud.bigtable.admin.types.MaterializedView` A materialized view object that can be referenced in SQL queries. @@ -4715,14 +4715,14 @@ def delete_materialized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_delete_materialized_view(): # Create a client - client = bigtable_admin_v2.BigtableInstanceAdminClient() + client = admin.BigtableInstanceAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteMaterializedViewRequest( + request = admin.DeleteMaterializedViewRequest( name="name_value", ) @@ -4730,7 +4730,7 @@ def sample_delete_materialized_view(): client.delete_materialized_view(request=request) Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteMaterializedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.DeleteMaterializedViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.DeleteMaterializedView. name (str): diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/pagers.py b/google/cloud/bigtable/admin/services/bigtable_instance_admin/pagers.py similarity index 89% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/pagers.py rename to google/cloud/bigtable/admin/services/bigtable_instance_admin/pagers.py index ce5b67b27..58efe9c51 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/pagers.py +++ b/google/cloud/bigtable/admin/services/bigtable_instance_admin/pagers.py @@ -37,15 +37,15 @@ OptionalRetry = Union[retries.Retry, object, None] # type: ignore OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin.types import bigtable_instance_admin +from google.cloud.bigtable.admin.types import instance class ListAppProfilesPager: """A pager for iterating through ``list_app_profiles`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListAppProfilesResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListAppProfilesResponse` object, and provides an ``__iter__`` method to iterate through its ``app_profiles`` field. @@ -54,7 +54,7 @@ class ListAppProfilesPager: through the ``app_profiles`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListAppProfilesResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListAppProfilesResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -74,9 +74,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListAppProfilesRequest): + request (google.cloud.bigtable.admin.types.ListAppProfilesRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListAppProfilesResponse): + response (google.cloud.bigtable.admin.types.ListAppProfilesResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -121,7 +121,7 @@ class ListAppProfilesAsyncPager: """A pager for iterating through ``list_app_profiles`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListAppProfilesResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListAppProfilesResponse` object, and provides an ``__aiter__`` method to iterate through its ``app_profiles`` field. @@ -130,7 +130,7 @@ class ListAppProfilesAsyncPager: through the ``app_profiles`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListAppProfilesResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListAppProfilesResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -152,9 +152,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListAppProfilesRequest): + request (google.cloud.bigtable.admin.types.ListAppProfilesRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListAppProfilesResponse): + response (google.cloud.bigtable.admin.types.ListAppProfilesResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -205,7 +205,7 @@ class ListHotTabletsPager: """A pager for iterating through ``list_hot_tablets`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListHotTabletsResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListHotTabletsResponse` object, and provides an ``__iter__`` method to iterate through its ``hot_tablets`` field. @@ -214,7 +214,7 @@ class ListHotTabletsPager: through the ``hot_tablets`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListHotTabletsResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListHotTabletsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -234,9 +234,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListHotTabletsRequest): + request (google.cloud.bigtable.admin.types.ListHotTabletsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListHotTabletsResponse): + response (google.cloud.bigtable.admin.types.ListHotTabletsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -281,7 +281,7 @@ class ListHotTabletsAsyncPager: """A pager for iterating through ``list_hot_tablets`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListHotTabletsResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListHotTabletsResponse` object, and provides an ``__aiter__`` method to iterate through its ``hot_tablets`` field. @@ -290,7 +290,7 @@ class ListHotTabletsAsyncPager: through the ``hot_tablets`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListHotTabletsResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListHotTabletsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -312,9 +312,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListHotTabletsRequest): + request (google.cloud.bigtable.admin.types.ListHotTabletsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListHotTabletsResponse): + response (google.cloud.bigtable.admin.types.ListHotTabletsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -365,7 +365,7 @@ class ListLogicalViewsPager: """A pager for iterating through ``list_logical_views`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListLogicalViewsResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListLogicalViewsResponse` object, and provides an ``__iter__`` method to iterate through its ``logical_views`` field. @@ -374,7 +374,7 @@ class ListLogicalViewsPager: through the ``logical_views`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListLogicalViewsResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListLogicalViewsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -394,9 +394,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListLogicalViewsRequest): + request (google.cloud.bigtable.admin.types.ListLogicalViewsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListLogicalViewsResponse): + response (google.cloud.bigtable.admin.types.ListLogicalViewsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -441,7 +441,7 @@ class ListLogicalViewsAsyncPager: """A pager for iterating through ``list_logical_views`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListLogicalViewsResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListLogicalViewsResponse` object, and provides an ``__aiter__`` method to iterate through its ``logical_views`` field. @@ -450,7 +450,7 @@ class ListLogicalViewsAsyncPager: through the ``logical_views`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListLogicalViewsResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListLogicalViewsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -472,9 +472,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListLogicalViewsRequest): + request (google.cloud.bigtable.admin.types.ListLogicalViewsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListLogicalViewsResponse): + response (google.cloud.bigtable.admin.types.ListLogicalViewsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -525,7 +525,7 @@ class ListMaterializedViewsPager: """A pager for iterating through ``list_materialized_views`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListMaterializedViewsResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListMaterializedViewsResponse` object, and provides an ``__iter__`` method to iterate through its ``materialized_views`` field. @@ -534,7 +534,7 @@ class ListMaterializedViewsPager: through the ``materialized_views`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListMaterializedViewsResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListMaterializedViewsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -554,9 +554,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListMaterializedViewsRequest): + request (google.cloud.bigtable.admin.types.ListMaterializedViewsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListMaterializedViewsResponse): + response (google.cloud.bigtable.admin.types.ListMaterializedViewsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -601,7 +601,7 @@ class ListMaterializedViewsAsyncPager: """A pager for iterating through ``list_materialized_views`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListMaterializedViewsResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListMaterializedViewsResponse` object, and provides an ``__aiter__`` method to iterate through its ``materialized_views`` field. @@ -610,7 +610,7 @@ class ListMaterializedViewsAsyncPager: through the ``materialized_views`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListMaterializedViewsResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListMaterializedViewsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -632,9 +632,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListMaterializedViewsRequest): + request (google.cloud.bigtable.admin.types.ListMaterializedViewsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListMaterializedViewsResponse): + response (google.cloud.bigtable.admin.types.ListMaterializedViewsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/README.rst b/google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/README.rst similarity index 100% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/README.rst rename to google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/README.rst diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/__init__.py b/google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/__init__.py rename to google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/__init__.py diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/base.py b/google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/base.py similarity index 98% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/base.py rename to google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/base.py index f5ceeeb68..104ef0333 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/base.py +++ b/google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/base.py @@ -16,7 +16,7 @@ import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -28,8 +28,8 @@ from google.oauth2 import service_account # type: ignore import google.protobuf -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin.types import bigtable_instance_admin +from google.cloud.bigtable.admin.types import instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -81,9 +81,10 @@ def __init__( credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment. - credentials_file (Optional[str]): A file with credentials that can + credentials_file (Optional[str]): Deprecated. A file with credentials that can be loaded with :func:`google.auth.load_credentials_from_file`. - This argument is mutually exclusive with credentials. + This argument is mutually exclusive with credentials. This argument will be + removed in the next major version of this library. scopes (Optional[Sequence[str]]): A list of scopes. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc.py b/google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/grpc.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc.py rename to google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/grpc.py index a294144ef..146b08568 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc.py +++ b/google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/grpc.py @@ -31,8 +31,8 @@ import grpc # type: ignore import proto # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin.types import bigtable_instance_admin +from google.cloud.bigtable.admin.types import instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -160,9 +160,10 @@ def __init__( are specified, the client will attempt to ascertain the credentials from the environment. This argument is ignored if a ``channel`` instance is provided. - credentials_file (Optional[str]): A file with credentials that can + credentials_file (Optional[str]): Deprecated. A file with credentials that can be loaded with :func:`google.auth.load_credentials_from_file`. This argument is ignored if a ``channel`` instance is provided. + This argument will be removed in the next major version of this library. scopes (Optional(Sequence[str])): A list of scopes. This argument is ignored if a ``channel`` instance is provided. channel (Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]]): @@ -296,9 +297,10 @@ def create_channel( credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. - credentials_file (Optional[str]): A file with credentials that can + credentials_file (Optional[str]): Deprecated. A file with credentials that can be loaded with :func:`google.auth.load_credentials_from_file`. - This argument is mutually exclusive with credentials. + This argument is mutually exclusive with credentials. This argument will be + removed in the next major version of this library. scopes (Optional[Sequence[str]]): A optional list of scopes needed for this service. These are only used when credentials are not specified and are passed to :func:`google.auth.default`. diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py b/google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/grpc_asyncio.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py rename to google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/grpc_asyncio.py index aae0f44c4..e44d20790 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py +++ b/google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/grpc_asyncio.py @@ -34,8 +34,8 @@ import proto # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin.types import bigtable_instance_admin +from google.cloud.bigtable.admin.types import instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -157,8 +157,9 @@ def create_channel( credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. - credentials_file (Optional[str]): A file with credentials that can - be loaded with :func:`google.auth.load_credentials_from_file`. + credentials_file (Optional[str]): Deprecated. A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. This argument will be + removed in the next major version of this library. scopes (Optional[Sequence[str]]): A optional list of scopes needed for this service. These are only used when credentials are not specified and are passed to :func:`google.auth.default`. @@ -209,9 +210,10 @@ def __init__( are specified, the client will attempt to ascertain the credentials from the environment. This argument is ignored if a ``channel`` instance is provided. - credentials_file (Optional[str]): A file with credentials that can + credentials_file (Optional[str]): Deprecated. A file with credentials that can be loaded with :func:`google.auth.load_credentials_from_file`. This argument is ignored if a ``channel`` instance is provided. + This argument will be removed in the next major version of this library. scopes (Optional[Sequence[str]]): A optional list of scopes needed for this service. These are only used when credentials are not specified and are passed to :func:`google.auth.default`. diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest.py b/google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/rest.py similarity index 98% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest.py rename to google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/rest.py index 12af0792b..672ba5d82 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest.py +++ b/google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/rest.py @@ -34,8 +34,8 @@ import warnings -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin.types import bigtable_instance_admin +from google.cloud.bigtable.admin.types import instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore @@ -1719,9 +1719,10 @@ def __init__( are specified, the client will attempt to ascertain the credentials from the environment. - credentials_file (Optional[str]): A file with credentials that can + credentials_file (Optional[str]): Deprecated. A file with credentials that can be loaded with :func:`google.auth.load_credentials_from_file`. - This argument is ignored if ``channel`` is provided. + This argument is ignored if ``channel`` is provided. This argument will be + removed in the next major version of this library. scopes (Optional(Sequence[str])): A list of scopes. This argument is ignored if ``channel`` is provided. client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client @@ -1911,7 +1912,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.CreateAppProfile", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.CreateAppProfile", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "CreateAppProfile", @@ -1962,7 +1963,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.create_app_profile", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.create_app_profile", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "CreateAppProfile", @@ -2068,7 +2069,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.CreateCluster", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.CreateCluster", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "CreateCluster", @@ -2115,7 +2116,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.create_cluster", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.create_cluster", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "CreateCluster", @@ -2221,7 +2222,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.CreateInstance", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.CreateInstance", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "CreateInstance", @@ -2268,7 +2269,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.create_instance", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.create_instance", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "CreateInstance", @@ -2376,7 +2377,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.CreateLogicalView", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.CreateLogicalView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "CreateLogicalView", @@ -2425,7 +2426,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.create_logical_view", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.create_logical_view", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "CreateLogicalView", @@ -2533,7 +2534,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.CreateMaterializedView", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.CreateMaterializedView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "CreateMaterializedView", @@ -2580,7 +2581,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.create_materialized_view", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.create_materialized_view", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "CreateMaterializedView", @@ -2676,7 +2677,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.DeleteAppProfile", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.DeleteAppProfile", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "DeleteAppProfile", @@ -2786,7 +2787,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.DeleteCluster", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.DeleteCluster", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "DeleteCluster", @@ -2894,7 +2895,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.DeleteInstance", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.DeleteInstance", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "DeleteInstance", @@ -3004,7 +3005,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.DeleteLogicalView", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.DeleteLogicalView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "DeleteLogicalView", @@ -3116,7 +3117,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.DeleteMaterializedView", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.DeleteMaterializedView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "DeleteMaterializedView", @@ -3231,7 +3232,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.GetAppProfile", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.GetAppProfile", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "GetAppProfile", @@ -3279,7 +3280,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.get_app_profile", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.get_app_profile", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "GetAppProfile", @@ -3381,7 +3382,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.GetCluster", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.GetCluster", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "GetCluster", @@ -3429,7 +3430,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.get_cluster", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.get_cluster", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "GetCluster", @@ -3606,7 +3607,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.GetIamPolicy", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.GetIamPolicy", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "GetIamPolicy", @@ -3655,7 +3656,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.get_iam_policy", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.get_iam_policy", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "GetIamPolicy", @@ -3759,7 +3760,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.GetInstance", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.GetInstance", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "GetInstance", @@ -3807,7 +3808,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.get_instance", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.get_instance", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "GetInstance", @@ -3909,7 +3910,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.GetLogicalView", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.GetLogicalView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "GetLogicalView", @@ -3957,7 +3958,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.get_logical_view", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.get_logical_view", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "GetLogicalView", @@ -4059,7 +4060,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.GetMaterializedView", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.GetMaterializedView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "GetMaterializedView", @@ -4109,7 +4110,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.get_materialized_view", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.get_materialized_view", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "GetMaterializedView", @@ -4211,7 +4212,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.ListAppProfiles", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.ListAppProfiles", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "ListAppProfiles", @@ -4265,7 +4266,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.list_app_profiles", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.list_app_profiles", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "ListAppProfiles", @@ -4365,7 +4366,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.ListClusters", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.ListClusters", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "ListClusters", @@ -4415,7 +4416,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.list_clusters", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.list_clusters", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "ListClusters", @@ -4517,7 +4518,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.ListHotTablets", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.ListHotTablets", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "ListHotTablets", @@ -4567,7 +4568,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.list_hot_tablets", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.list_hot_tablets", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "ListHotTablets", @@ -4667,7 +4668,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.ListInstances", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.ListInstances", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "ListInstances", @@ -4717,7 +4718,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.list_instances", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.list_instances", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "ListInstances", @@ -4819,7 +4820,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.ListLogicalViews", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.ListLogicalViews", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "ListLogicalViews", @@ -4873,7 +4874,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.list_logical_views", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.list_logical_views", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "ListLogicalViews", @@ -4975,7 +4976,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.ListMaterializedViews", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.ListMaterializedViews", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "ListMaterializedViews", @@ -5029,7 +5030,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.list_materialized_views", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.list_materialized_views", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "ListMaterializedViews", @@ -5137,7 +5138,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.PartialUpdateCluster", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.PartialUpdateCluster", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "PartialUpdateCluster", @@ -5186,7 +5187,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.partial_update_cluster", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.partial_update_cluster", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "PartialUpdateCluster", @@ -5294,7 +5295,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.PartialUpdateInstance", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.PartialUpdateInstance", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "PartialUpdateInstance", @@ -5343,7 +5344,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.partial_update_instance", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.partial_update_instance", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "PartialUpdateInstance", @@ -5520,7 +5521,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.SetIamPolicy", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.SetIamPolicy", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "SetIamPolicy", @@ -5569,7 +5570,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.set_iam_policy", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.set_iam_policy", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "SetIamPolicy", @@ -5673,7 +5674,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.TestIamPermissions", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.TestIamPermissions", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "TestIamPermissions", @@ -5724,7 +5725,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.test_iam_permissions", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.test_iam_permissions", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "TestIamPermissions", @@ -5832,7 +5833,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.UpdateAppProfile", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.UpdateAppProfile", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "UpdateAppProfile", @@ -5881,7 +5882,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.update_app_profile", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.update_app_profile", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "UpdateAppProfile", @@ -5989,7 +5990,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.UpdateCluster", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.UpdateCluster", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "UpdateCluster", @@ -6036,7 +6037,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.update_cluster", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.update_cluster", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "UpdateCluster", @@ -6149,7 +6150,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.UpdateInstance", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.UpdateInstance", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "UpdateInstance", @@ -6198,7 +6199,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.update_instance", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.update_instance", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "UpdateInstance", @@ -6306,7 +6307,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.UpdateLogicalView", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.UpdateLogicalView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "UpdateLogicalView", @@ -6355,7 +6356,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.update_logical_view", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.update_logical_view", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "UpdateLogicalView", @@ -6463,7 +6464,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableInstanceAdminClient.UpdateMaterializedView", + f"Sending request for google.bigtable.admin.BigtableInstanceAdminClient.UpdateMaterializedView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "UpdateMaterializedView", @@ -6510,7 +6511,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableInstanceAdminClient.update_materialized_view", + "Received response for google.bigtable.admin.BigtableInstanceAdminClient.update_materialized_view", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", "rpcName": "UpdateMaterializedView", diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest_base.py b/google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/rest_base.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest_base.py rename to google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/rest_base.py index 9855756b8..50b2b5ff8 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest_base.py +++ b/google/cloud/bigtable/admin/services/bigtable_instance_admin/transports/rest_base.py @@ -24,8 +24,8 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin.types import bigtable_instance_admin +from google.cloud.bigtable.admin.types import instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/__init__.py b/google/cloud/bigtable/admin/services/bigtable_table_admin/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/__init__.py rename to google/cloud/bigtable/admin/services/bigtable_table_admin/__init__.py diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py b/google/cloud/bigtable/admin/services/bigtable_table_admin/async_client.py similarity index 92% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py rename to google/cloud/bigtable/admin/services/bigtable_table_admin/async_client.py index d79d1b088..a5e712e2c 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py +++ b/google/cloud/bigtable/admin/services/bigtable_table_admin/async_client.py @@ -29,7 +29,7 @@ Union, ) -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -47,11 +47,11 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import pagers -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table -from google.cloud.bigtable_admin_v2.types import types +from google.cloud.bigtable.admin.services.bigtable_table_admin import pagers +from google.cloud.bigtable.admin.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import table +from google.cloud.bigtable.admin.types import table as gba_table +from google.cloud.bigtable.admin.types import types from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -313,7 +313,7 @@ def __init__( std_logging.DEBUG ): # pragma: NO COVER _LOGGER.debug( - "Created client `google.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient`.", + "Created client `google.bigtable.admin.BaseBigtableTableAdminAsyncClient`.", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "universeDomain": getattr( @@ -355,14 +355,14 @@ async def create_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_create_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.CreateTableRequest( + request = admin.CreateTableRequest( parent="parent_value", table_id="table_id_value", ) @@ -374,7 +374,7 @@ async def sample_create_table(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.CreateTableRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable] parent (:class:`str`): @@ -394,7 +394,7 @@ async def sample_create_table(): This corresponds to the ``table_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - table (:class:`google.cloud.bigtable_admin_v2.types.Table`): + table (:class:`google.cloud.bigtable.admin.types.Table`): Required. The Table to create. This corresponds to the ``table`` field on the ``request`` instance; if ``request`` is provided, this @@ -408,7 +408,7 @@ async def sample_create_table(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Table: + google.cloud.bigtable.admin.types.Table: A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its @@ -501,14 +501,14 @@ async def create_table_from_snapshot( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_create_table_from_snapshot(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.CreateTableFromSnapshotRequest( + request = admin.CreateTableFromSnapshotRequest( parent="parent_value", table_id="table_id_value", source_snapshot="source_snapshot_value", @@ -525,7 +525,7 @@ async def sample_create_table_from_snapshot(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateTableFromSnapshotRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.CreateTableFromSnapshotRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot] @@ -572,7 +572,7 @@ async def sample_create_table_from_snapshot(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp. + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Table` A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster. @@ -658,14 +658,14 @@ async def list_tables( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_list_tables(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListTablesRequest( + request = admin.ListTablesRequest( parent="parent_value", ) @@ -677,7 +677,7 @@ async def sample_list_tables(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListTablesRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.ListTablesRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] parent (:class:`str`): @@ -697,7 +697,7 @@ async def sample_list_tables(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListTablesAsyncPager: + google.cloud.bigtable.admin.services.bigtable_table_admin.pagers.ListTablesAsyncPager: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] @@ -785,14 +785,14 @@ async def get_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_get_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetTableRequest( + request = admin.GetTableRequest( name="name_value", ) @@ -803,7 +803,7 @@ async def sample_get_table(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.GetTableRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable] name (:class:`str`): @@ -823,7 +823,7 @@ async def sample_get_table(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Table: + google.cloud.bigtable.admin.types.Table: A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its @@ -900,14 +900,14 @@ async def update_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_update_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.UpdateTableRequest( + request = admin.UpdateTableRequest( ) # Make the request @@ -921,10 +921,10 @@ async def sample_update_table(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.UpdateTableRequest, dict]]): The request object. The request for [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]. - table (:class:`google.cloud.bigtable_admin_v2.types.Table`): + table (:class:`google.cloud.bigtable.admin.types.Table`): Required. The table to update. The table's ``name`` field is used to identify the table to update. @@ -936,14 +936,14 @@ async def sample_update_table(): specifying which fields (e.g. ``change_stream_config``) in the ``table`` field should be updated. This mask is relative to the ``table`` field, not to the request - message. The wildcard (*) path is currently not + message. The wildcard (\*) path is currently not supported. Currently UpdateTable is only supported for the following fields: - - ``change_stream_config`` - - ``change_stream_config.retention_period`` - - ``deletion_protection`` - - ``row_key_schema`` + - ``change_stream_config`` + - ``change_stream_config.retention_period`` + - ``deletion_protection`` + - ``row_key_schema`` If ``column_families`` is set in ``update_mask``, it will return an UNIMPLEMENTED error. @@ -963,7 +963,7 @@ async def sample_update_table(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp. + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Table` A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster. @@ -1050,14 +1050,14 @@ async def delete_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_delete_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteTableRequest( + request = admin.DeleteTableRequest( name="name_value", ) @@ -1065,7 +1065,7 @@ async def sample_delete_table(): await client.delete_table(request=request) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.DeleteTableRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable] name (:class:`str`): @@ -1153,14 +1153,14 @@ async def undelete_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_undelete_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.UndeleteTableRequest( + request = admin.UndeleteTableRequest( name="name_value", ) @@ -1175,7 +1175,7 @@ async def sample_undelete_table(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UndeleteTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.UndeleteTableRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable] name (:class:`str`): @@ -1198,7 +1198,7 @@ async def sample_undelete_table(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp. + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Table` A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster. @@ -1284,14 +1284,14 @@ async def create_authorized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_create_authorized_view(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.CreateAuthorizedViewRequest( + request = admin.CreateAuthorizedViewRequest( parent="parent_value", authorized_view_id="authorized_view_id_value", ) @@ -1307,7 +1307,7 @@ async def sample_create_authorized_view(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateAuthorizedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.CreateAuthorizedViewRequest, dict]]): The request object. The request for [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView] parent (:class:`str`): @@ -1318,7 +1318,7 @@ async def sample_create_authorized_view(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - authorized_view (:class:`google.cloud.bigtable_admin_v2.types.AuthorizedView`): + authorized_view (:class:`google.cloud.bigtable.admin.types.AuthorizedView`): Required. The AuthorizedView to create. @@ -1347,7 +1347,7 @@ async def sample_create_authorized_view(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.AuthorizedView` AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.AuthorizedView` AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users can configure access to each Authorized View independently from the table and use the existing Data APIs to access the subset of data. @@ -1436,14 +1436,14 @@ async def list_authorized_views( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_list_authorized_views(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListAuthorizedViewsRequest( + request = admin.ListAuthorizedViewsRequest( parent="parent_value", ) @@ -1455,7 +1455,7 @@ async def sample_list_authorized_views(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.ListAuthorizedViewsRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] parent (:class:`str`): @@ -1475,7 +1475,7 @@ async def sample_list_authorized_views(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListAuthorizedViewsAsyncPager: + google.cloud.bigtable.admin.services.bigtable_table_admin.pagers.ListAuthorizedViewsAsyncPager: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] @@ -1565,14 +1565,14 @@ async def get_authorized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_get_authorized_view(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetAuthorizedViewRequest( + request = admin.GetAuthorizedViewRequest( name="name_value", ) @@ -1583,7 +1583,7 @@ async def sample_get_authorized_view(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetAuthorizedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.GetAuthorizedViewRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView] name (:class:`str`): @@ -1603,7 +1603,7 @@ async def sample_get_authorized_view(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.AuthorizedView: + google.cloud.bigtable.admin.types.AuthorizedView: AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users can configure access to each Authorized @@ -1684,14 +1684,14 @@ async def update_authorized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_update_authorized_view(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.UpdateAuthorizedViewRequest( + request = admin.UpdateAuthorizedViewRequest( ) # Make the request @@ -1705,10 +1705,10 @@ async def sample_update_authorized_view(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateAuthorizedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.UpdateAuthorizedViewRequest, dict]]): The request object. The request for [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]. - authorized_view (:class:`google.cloud.bigtable_admin_v2.types.AuthorizedView`): + authorized_view (:class:`google.cloud.bigtable.admin.types.AuthorizedView`): Required. The AuthorizedView to update. The ``name`` in ``authorized_view`` is used to identify the AuthorizedView. AuthorizedView name must in this format: @@ -1742,7 +1742,7 @@ async def sample_update_authorized_view(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.AuthorizedView` AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.AuthorizedView` AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users can configure access to each Authorized View independently from the table and use the existing Data APIs to access the subset of data. @@ -1831,14 +1831,14 @@ async def delete_authorized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_delete_authorized_view(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteAuthorizedViewRequest( + request = admin.DeleteAuthorizedViewRequest( name="name_value", ) @@ -1846,7 +1846,7 @@ async def sample_delete_authorized_view(): await client.delete_authorized_view(request=request) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteAuthorizedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.DeleteAuthorizedViewRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView] name (:class:`str`): @@ -1942,14 +1942,14 @@ async def modify_column_families( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_modify_column_families(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.ModifyColumnFamiliesRequest( + request = admin.ModifyColumnFamiliesRequest( name="name_value", ) @@ -1960,7 +1960,7 @@ async def sample_modify_column_families(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ModifyColumnFamiliesRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.ModifyColumnFamiliesRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies] name (:class:`str`): @@ -1971,7 +1971,7 @@ async def sample_modify_column_families(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - modifications (:class:`MutableSequence[google.cloud.bigtable_admin_v2.types.ModifyColumnFamiliesRequest.Modification]`): + modifications (:class:`MutableSequence[google.cloud.bigtable.admin.types.ModifyColumnFamiliesRequest.Modification]`): Required. Modifications to be atomically applied to the specified table's families. Entries are applied in @@ -1992,7 +1992,7 @@ async def sample_modify_column_families(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Table: + google.cloud.bigtable.admin.types.Table: A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its @@ -2072,14 +2072,14 @@ async def drop_row_range( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_drop_row_range(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.DropRowRangeRequest( + request = admin.DropRowRangeRequest( row_key_prefix=b'row_key_prefix_blob', name="name_value", ) @@ -2088,7 +2088,7 @@ async def sample_drop_row_range(): await client.drop_row_range(request=request) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DropRowRangeRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.DropRowRangeRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange] retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, @@ -2154,14 +2154,14 @@ async def generate_consistency_token( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_generate_consistency_token(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.GenerateConsistencyTokenRequest( + request = admin.GenerateConsistencyTokenRequest( name="name_value", ) @@ -2172,7 +2172,7 @@ async def sample_generate_consistency_token(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GenerateConsistencyTokenRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.GenerateConsistencyTokenRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] name (:class:`str`): @@ -2192,7 +2192,7 @@ async def sample_generate_consistency_token(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.GenerateConsistencyTokenResponse: + google.cloud.bigtable.admin.types.GenerateConsistencyTokenResponse: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] @@ -2274,14 +2274,14 @@ async def check_consistency( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_check_consistency(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.CheckConsistencyRequest( + request = admin.CheckConsistencyRequest( name="name_value", consistency_token="consistency_token_value", ) @@ -2293,7 +2293,7 @@ async def sample_check_consistency(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CheckConsistencyRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.CheckConsistencyRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] name (:class:`str`): @@ -2320,7 +2320,7 @@ async def sample_check_consistency(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.CheckConsistencyResponse: + google.cloud.bigtable.admin.types.CheckConsistencyResponse: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] @@ -2410,14 +2410,14 @@ async def snapshot_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_snapshot_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.SnapshotTableRequest( + request = admin.SnapshotTableRequest( name="name_value", cluster="cluster_value", snapshot_id="snapshot_id_value", @@ -2434,7 +2434,7 @@ async def sample_snapshot_table(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.SnapshotTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.SnapshotTableRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable] @@ -2487,7 +2487,7 @@ async def sample_snapshot_table(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Snapshot` A snapshot of a table at a particular time. A snapshot can be used as a + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Snapshot` A snapshot of a table at a particular time. A snapshot can be used as a checkpoint for data restoration or a data source for a new table. @@ -2589,14 +2589,14 @@ async def get_snapshot( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_get_snapshot(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetSnapshotRequest( + request = admin.GetSnapshotRequest( name="name_value", ) @@ -2607,7 +2607,7 @@ async def sample_get_snapshot(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetSnapshotRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.GetSnapshotRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot] @@ -2634,7 +2634,7 @@ async def sample_get_snapshot(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Snapshot: + google.cloud.bigtable.admin.types.Snapshot: A snapshot of a table at a particular time. A snapshot can be used as a checkpoint for data restoration or a @@ -2728,14 +2728,14 @@ async def list_snapshots( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_list_snapshots(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListSnapshotsRequest( + request = admin.ListSnapshotsRequest( parent="parent_value", ) @@ -2747,7 +2747,7 @@ async def sample_list_snapshots(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListSnapshotsRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.ListSnapshotsRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] @@ -2777,7 +2777,7 @@ async def sample_list_snapshots(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListSnapshotsAsyncPager: + google.cloud.bigtable.admin.services.bigtable_table_admin.pagers.ListSnapshotsAsyncPager: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] @@ -2881,14 +2881,14 @@ async def delete_snapshot( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_delete_snapshot(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteSnapshotRequest( + request = admin.DeleteSnapshotRequest( name="name_value", ) @@ -2896,7 +2896,7 @@ async def sample_delete_snapshot(): await client.delete_snapshot(request=request) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteSnapshotRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.DeleteSnapshotRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot] @@ -2998,17 +2998,17 @@ async def create_backup( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_create_backup(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - backup = bigtable_admin_v2.Backup() + backup = admin.Backup() backup.source_table = "source_table_value" - request = bigtable_admin_v2.CreateBackupRequest( + request = admin.CreateBackupRequest( parent="parent_value", backup_id="backup_id_value", backup=backup, @@ -3025,7 +3025,7 @@ async def sample_create_backup(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateBackupRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.CreateBackupRequest, dict]]): The request object. The request for [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]. parent (:class:`str`): @@ -3044,12 +3044,12 @@ async def sample_create_backup(): full backup name, of the form: ``projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}``. This string must be between 1 and 50 characters in - length and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]*. + length and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]\*. This corresponds to the ``backup_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - backup (:class:`google.cloud.bigtable_admin_v2.types.Backup`): + backup (:class:`google.cloud.bigtable.admin.types.Backup`): Required. The backup to create. This corresponds to the ``backup`` field on the ``request`` instance; if ``request`` is provided, this @@ -3067,7 +3067,7 @@ async def sample_create_backup(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.Backup` A + :class:`google.cloud.bigtable.admin.types.Backup` A backup of a Cloud Bigtable table. """ @@ -3153,14 +3153,14 @@ async def get_backup( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_get_backup(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetBackupRequest( + request = admin.GetBackupRequest( name="name_value", ) @@ -3171,7 +3171,7 @@ async def sample_get_backup(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetBackupRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.GetBackupRequest, dict]]): The request object. The request for [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup]. name (:class:`str`): @@ -3190,7 +3190,7 @@ async def sample_get_backup(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Backup: + google.cloud.bigtable.admin.types.Backup: A backup of a Cloud Bigtable table. """ # Create or coerce a protobuf request object. @@ -3263,17 +3263,17 @@ async def update_backup( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_update_backup(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - backup = bigtable_admin_v2.Backup() + backup = admin.Backup() backup.source_table = "source_table_value" - request = bigtable_admin_v2.UpdateBackupRequest( + request = admin.UpdateBackupRequest( backup=backup, ) @@ -3284,16 +3284,16 @@ async def sample_update_backup(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateBackupRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.UpdateBackupRequest, dict]]): The request object. The request for [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup]. - backup (:class:`google.cloud.bigtable_admin_v2.types.Backup`): + backup (:class:`google.cloud.bigtable.admin.types.Backup`): Required. The backup to update. ``backup.name``, and the fields to be updated as specified by ``update_mask`` are required. Other fields are ignored. Update is only supported for the following fields: - - ``backup.expire_time``. + - ``backup.expire_time``. This corresponds to the ``backup`` field on the ``request`` instance; if ``request`` is provided, this @@ -3319,7 +3319,7 @@ async def sample_update_backup(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Backup: + google.cloud.bigtable.admin.types.Backup: A backup of a Cloud Bigtable table. """ # Create or coerce a protobuf request object. @@ -3395,14 +3395,14 @@ async def delete_backup( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_delete_backup(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteBackupRequest( + request = admin.DeleteBackupRequest( name="name_value", ) @@ -3410,7 +3410,7 @@ async def sample_delete_backup(): await client.delete_backup(request=request) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteBackupRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.DeleteBackupRequest, dict]]): The request object. The request for [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup]. name (:class:`str`): @@ -3496,14 +3496,14 @@ async def list_backups( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_list_backups(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListBackupsRequest( + request = admin.ListBackupsRequest( parent="parent_value", ) @@ -3515,7 +3515,7 @@ async def sample_list_backups(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListBackupsRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.ListBackupsRequest, dict]]): The request object. The request for [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. parent (:class:`str`): @@ -3538,7 +3538,7 @@ async def sample_list_backups(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListBackupsAsyncPager: + google.cloud.bigtable.admin.services.bigtable_table_admin.pagers.ListBackupsAsyncPager: The response for [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. @@ -3632,14 +3632,14 @@ async def _restore_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_restore_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.RestoreTableRequest( + request = admin.RestoreTableRequest( backup="backup_value", parent="parent_value", table_id="table_id_value", @@ -3656,7 +3656,7 @@ async def sample_restore_table(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.RestoreTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.RestoreTableRequest, dict]]): The request object. The request for [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, @@ -3671,7 +3671,7 @@ async def sample_restore_table(): google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp. + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Table` A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster. @@ -3741,14 +3741,14 @@ async def copy_backup( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_copy_backup(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.CopyBackupRequest( + request = admin.CopyBackupRequest( parent="parent_value", backup_id="backup_id_value", source_backup="source_backup_value", @@ -3765,7 +3765,7 @@ async def sample_copy_backup(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CopyBackupRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.CopyBackupRequest, dict]]): The request object. The request for [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]. parent (:class:`str`): @@ -3784,7 +3784,7 @@ async def sample_copy_backup(): name, of the form: ``projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}``. This string must be between 1 and 50 characters in - length and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]*. + length and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]\*. This corresponds to the ``backup_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -3825,7 +3825,7 @@ async def sample_copy_backup(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.Backup` A + :class:`google.cloud.bigtable.admin.types.Backup` A backup of a Cloud Bigtable table. """ @@ -3914,12 +3914,12 @@ async def get_iam_policy( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_get_iam_policy(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -3971,19 +3971,19 @@ async def sample_get_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -4053,12 +4053,12 @@ async def set_iam_policy( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_set_iam_policy(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -4110,19 +4110,19 @@ async def sample_set_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -4193,12 +4193,12 @@ async def test_iam_permissions( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_test_iam_permissions(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -4317,17 +4317,17 @@ async def create_schema_bundle( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_create_schema_bundle(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - schema_bundle = bigtable_admin_v2.SchemaBundle() + schema_bundle = admin.SchemaBundle() schema_bundle.proto_schema.proto_descriptors = b'proto_descriptors_blob' - request = bigtable_admin_v2.CreateSchemaBundleRequest( + request = admin.CreateSchemaBundleRequest( parent="parent_value", schema_bundle_id="schema_bundle_id_value", schema_bundle=schema_bundle, @@ -4344,7 +4344,7 @@ async def sample_create_schema_bundle(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateSchemaBundleRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.CreateSchemaBundleRequest, dict]]): The request object. The request for [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle]. parent (:class:`str`): @@ -4364,7 +4364,7 @@ async def sample_create_schema_bundle(): This corresponds to the ``schema_bundle_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - schema_bundle (:class:`google.cloud.bigtable_admin_v2.types.SchemaBundle`): + schema_bundle (:class:`google.cloud.bigtable.admin.types.SchemaBundle`): Required. The schema bundle to create. @@ -4384,7 +4384,7 @@ async def sample_create_schema_bundle(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.SchemaBundle` + :class:`google.cloud.bigtable.admin.types.SchemaBundle` A named collection of related schemas. """ @@ -4472,17 +4472,17 @@ async def update_schema_bundle( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_update_schema_bundle(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - schema_bundle = bigtable_admin_v2.SchemaBundle() + schema_bundle = admin.SchemaBundle() schema_bundle.proto_schema.proto_descriptors = b'proto_descriptors_blob' - request = bigtable_admin_v2.UpdateSchemaBundleRequest( + request = admin.UpdateSchemaBundleRequest( schema_bundle=schema_bundle, ) @@ -4497,10 +4497,10 @@ async def sample_update_schema_bundle(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateSchemaBundleRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.UpdateSchemaBundleRequest, dict]]): The request object. The request for [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle]. - schema_bundle (:class:`google.cloud.bigtable_admin_v2.types.SchemaBundle`): + schema_bundle (:class:`google.cloud.bigtable.admin.types.SchemaBundle`): Required. The schema bundle to update. The schema bundle's ``name`` field is used to identify @@ -4530,7 +4530,7 @@ async def sample_update_schema_bundle(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.SchemaBundle` + :class:`google.cloud.bigtable.admin.types.SchemaBundle` A named collection of related schemas. """ @@ -4618,14 +4618,14 @@ async def get_schema_bundle( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_get_schema_bundle(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetSchemaBundleRequest( + request = admin.GetSchemaBundleRequest( name="name_value", ) @@ -4636,7 +4636,7 @@ async def sample_get_schema_bundle(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetSchemaBundleRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.GetSchemaBundleRequest, dict]]): The request object. The request for [GetSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundle]. name (:class:`str`): @@ -4656,7 +4656,7 @@ async def sample_get_schema_bundle(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.SchemaBundle: + google.cloud.bigtable.admin.types.SchemaBundle: A named collection of related schemas. @@ -4733,14 +4733,14 @@ async def list_schema_bundles( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_list_schema_bundles(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListSchemaBundlesRequest( + request = admin.ListSchemaBundlesRequest( parent="parent_value", ) @@ -4752,7 +4752,7 @@ async def sample_list_schema_bundles(): print(response) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListSchemaBundlesRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.ListSchemaBundlesRequest, dict]]): The request object. The request for [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]. parent (:class:`str`): @@ -4772,7 +4772,7 @@ async def sample_list_schema_bundles(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListSchemaBundlesAsyncPager: + google.cloud.bigtable.admin.services.bigtable_table_admin.pagers.ListSchemaBundlesAsyncPager: The response for [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]. @@ -4862,14 +4862,14 @@ async def delete_schema_bundle( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin async def sample_delete_schema_bundle(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminAsyncClient() + client = admin.BigtableTableAdminAsyncClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteSchemaBundleRequest( + request = admin.DeleteSchemaBundleRequest( name="name_value", ) @@ -4877,7 +4877,7 @@ async def sample_delete_schema_bundle(): await client.delete_schema_bundle(request=request) Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteSchemaBundleRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin.types.DeleteSchemaBundleRequest, dict]]): The request object. The request for [DeleteSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundle]. name (:class:`str`): diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py b/google/cloud/bigtable/admin/services/bigtable_table_admin/client.py similarity index 92% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py rename to google/cloud/bigtable/admin/services/bigtable_table_admin/client.py index d0030af92..ed0b701cc 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py +++ b/google/cloud/bigtable/admin/services/bigtable_table_admin/client.py @@ -34,7 +34,7 @@ ) import warnings -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -63,11 +63,11 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import pagers -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table -from google.cloud.bigtable_admin_v2.types import types +from google.cloud.bigtable.admin.services.bigtable_table_admin import pagers +from google.cloud.bigtable.admin.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import table +from google.cloud.bigtable.admin.types import table as gba_table +from google.cloud.bigtable.admin.types import types from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -873,7 +873,7 @@ def __init__( std_logging.DEBUG ): # pragma: NO COVER _LOGGER.debug( - "Created client `google.bigtable.admin_v2.BaseBigtableTableAdminClient`.", + "Created client `google.bigtable.admin.BaseBigtableTableAdminClient`.", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "universeDomain": getattr( @@ -915,14 +915,14 @@ def create_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_create_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.CreateTableRequest( + request = admin.CreateTableRequest( parent="parent_value", table_id="table_id_value", ) @@ -934,7 +934,7 @@ def sample_create_table(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateTableRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.CreateTableRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable] parent (str): @@ -954,7 +954,7 @@ def sample_create_table(): This corresponds to the ``table_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - table (google.cloud.bigtable_admin_v2.types.Table): + table (google.cloud.bigtable.admin.types.Table): Required. The Table to create. This corresponds to the ``table`` field on the ``request`` instance; if ``request`` is provided, this @@ -968,7 +968,7 @@ def sample_create_table(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Table: + google.cloud.bigtable.admin.types.Table: A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its @@ -1058,14 +1058,14 @@ def create_table_from_snapshot( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_create_table_from_snapshot(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.CreateTableFromSnapshotRequest( + request = admin.CreateTableFromSnapshotRequest( parent="parent_value", table_id="table_id_value", source_snapshot="source_snapshot_value", @@ -1082,7 +1082,7 @@ def sample_create_table_from_snapshot(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateTableFromSnapshotRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.CreateTableFromSnapshotRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot] @@ -1129,7 +1129,7 @@ def sample_create_table_from_snapshot(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp. + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Table` A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster. @@ -1214,14 +1214,14 @@ def list_tables( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_list_tables(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListTablesRequest( + request = admin.ListTablesRequest( parent="parent_value", ) @@ -1233,7 +1233,7 @@ def sample_list_tables(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListTablesRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.ListTablesRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] parent (str): @@ -1253,7 +1253,7 @@ def sample_list_tables(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListTablesPager: + google.cloud.bigtable.admin.services.bigtable_table_admin.pagers.ListTablesPager: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] @@ -1338,14 +1338,14 @@ def get_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_get_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetTableRequest( + request = admin.GetTableRequest( name="name_value", ) @@ -1356,7 +1356,7 @@ def sample_get_table(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetTableRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.GetTableRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable] name (str): @@ -1376,7 +1376,7 @@ def sample_get_table(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Table: + google.cloud.bigtable.admin.types.Table: A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its @@ -1450,14 +1450,14 @@ def update_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_update_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.UpdateTableRequest( + request = admin.UpdateTableRequest( ) # Make the request @@ -1471,10 +1471,10 @@ def sample_update_table(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateTableRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.UpdateTableRequest, dict]): The request object. The request for [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]. - table (google.cloud.bigtable_admin_v2.types.Table): + table (google.cloud.bigtable.admin.types.Table): Required. The table to update. The table's ``name`` field is used to identify the table to update. @@ -1486,14 +1486,14 @@ def sample_update_table(): specifying which fields (e.g. ``change_stream_config``) in the ``table`` field should be updated. This mask is relative to the ``table`` field, not to the request - message. The wildcard (*) path is currently not + message. The wildcard (\*) path is currently not supported. Currently UpdateTable is only supported for the following fields: - - ``change_stream_config`` - - ``change_stream_config.retention_period`` - - ``deletion_protection`` - - ``row_key_schema`` + - ``change_stream_config`` + - ``change_stream_config.retention_period`` + - ``deletion_protection`` + - ``row_key_schema`` If ``column_families`` is set in ``update_mask``, it will return an UNIMPLEMENTED error. @@ -1513,7 +1513,7 @@ def sample_update_table(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp. + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Table` A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster. @@ -1597,14 +1597,14 @@ def delete_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_delete_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteTableRequest( + request = admin.DeleteTableRequest( name="name_value", ) @@ -1612,7 +1612,7 @@ def sample_delete_table(): client.delete_table(request=request) Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteTableRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.DeleteTableRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable] name (str): @@ -1697,14 +1697,14 @@ def undelete_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_undelete_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.UndeleteTableRequest( + request = admin.UndeleteTableRequest( name="name_value", ) @@ -1719,7 +1719,7 @@ def sample_undelete_table(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.UndeleteTableRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.UndeleteTableRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable] name (str): @@ -1742,7 +1742,7 @@ def sample_undelete_table(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp. + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Table` A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster. @@ -1825,14 +1825,14 @@ def create_authorized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_create_authorized_view(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.CreateAuthorizedViewRequest( + request = admin.CreateAuthorizedViewRequest( parent="parent_value", authorized_view_id="authorized_view_id_value", ) @@ -1848,7 +1848,7 @@ def sample_create_authorized_view(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateAuthorizedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.CreateAuthorizedViewRequest, dict]): The request object. The request for [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView] parent (str): @@ -1859,7 +1859,7 @@ def sample_create_authorized_view(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - authorized_view (google.cloud.bigtable_admin_v2.types.AuthorizedView): + authorized_view (google.cloud.bigtable.admin.types.AuthorizedView): Required. The AuthorizedView to create. @@ -1888,7 +1888,7 @@ def sample_create_authorized_view(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.AuthorizedView` AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.AuthorizedView` AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users can configure access to each Authorized View independently from the table and use the existing Data APIs to access the subset of data. @@ -1974,14 +1974,14 @@ def list_authorized_views( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_list_authorized_views(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListAuthorizedViewsRequest( + request = admin.ListAuthorizedViewsRequest( parent="parent_value", ) @@ -1993,7 +1993,7 @@ def sample_list_authorized_views(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.ListAuthorizedViewsRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] parent (str): @@ -2013,7 +2013,7 @@ def sample_list_authorized_views(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListAuthorizedViewsPager: + google.cloud.bigtable.admin.services.bigtable_table_admin.pagers.ListAuthorizedViewsPager: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] @@ -2100,14 +2100,14 @@ def get_authorized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_get_authorized_view(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetAuthorizedViewRequest( + request = admin.GetAuthorizedViewRequest( name="name_value", ) @@ -2118,7 +2118,7 @@ def sample_get_authorized_view(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetAuthorizedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.GetAuthorizedViewRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView] name (str): @@ -2138,7 +2138,7 @@ def sample_get_authorized_view(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.AuthorizedView: + google.cloud.bigtable.admin.types.AuthorizedView: AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users can configure access to each Authorized @@ -2216,14 +2216,14 @@ def update_authorized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_update_authorized_view(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.UpdateAuthorizedViewRequest( + request = admin.UpdateAuthorizedViewRequest( ) # Make the request @@ -2237,10 +2237,10 @@ def sample_update_authorized_view(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateAuthorizedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.UpdateAuthorizedViewRequest, dict]): The request object. The request for [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]. - authorized_view (google.cloud.bigtable_admin_v2.types.AuthorizedView): + authorized_view (google.cloud.bigtable.admin.types.AuthorizedView): Required. The AuthorizedView to update. The ``name`` in ``authorized_view`` is used to identify the AuthorizedView. AuthorizedView name must in this format: @@ -2274,7 +2274,7 @@ def sample_update_authorized_view(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.AuthorizedView` AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.AuthorizedView` AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users can configure access to each Authorized View independently from the table and use the existing Data APIs to access the subset of data. @@ -2360,14 +2360,14 @@ def delete_authorized_view( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_delete_authorized_view(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteAuthorizedViewRequest( + request = admin.DeleteAuthorizedViewRequest( name="name_value", ) @@ -2375,7 +2375,7 @@ def sample_delete_authorized_view(): client.delete_authorized_view(request=request) Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteAuthorizedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.DeleteAuthorizedViewRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView] name (str): @@ -2468,14 +2468,14 @@ def modify_column_families( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_modify_column_families(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.ModifyColumnFamiliesRequest( + request = admin.ModifyColumnFamiliesRequest( name="name_value", ) @@ -2486,7 +2486,7 @@ def sample_modify_column_families(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.ModifyColumnFamiliesRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.ModifyColumnFamiliesRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies] name (str): @@ -2497,7 +2497,7 @@ def sample_modify_column_families(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - modifications (MutableSequence[google.cloud.bigtable_admin_v2.types.ModifyColumnFamiliesRequest.Modification]): + modifications (MutableSequence[google.cloud.bigtable.admin.types.ModifyColumnFamiliesRequest.Modification]): Required. Modifications to be atomically applied to the specified table's families. Entries are applied in @@ -2518,7 +2518,7 @@ def sample_modify_column_families(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Table: + google.cloud.bigtable.admin.types.Table: A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its @@ -2595,14 +2595,14 @@ def drop_row_range( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_drop_row_range(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.DropRowRangeRequest( + request = admin.DropRowRangeRequest( row_key_prefix=b'row_key_prefix_blob', name="name_value", ) @@ -2611,7 +2611,7 @@ def sample_drop_row_range(): client.drop_row_range(request=request) Args: - request (Union[google.cloud.bigtable_admin_v2.types.DropRowRangeRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.DropRowRangeRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange] retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -2675,14 +2675,14 @@ def generate_consistency_token( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_generate_consistency_token(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.GenerateConsistencyTokenRequest( + request = admin.GenerateConsistencyTokenRequest( name="name_value", ) @@ -2693,7 +2693,7 @@ def sample_generate_consistency_token(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.GenerateConsistencyTokenRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.GenerateConsistencyTokenRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] name (str): @@ -2713,7 +2713,7 @@ def sample_generate_consistency_token(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.GenerateConsistencyTokenResponse: + google.cloud.bigtable.admin.types.GenerateConsistencyTokenResponse: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] @@ -2794,14 +2794,14 @@ def check_consistency( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_check_consistency(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.CheckConsistencyRequest( + request = admin.CheckConsistencyRequest( name="name_value", consistency_token="consistency_token_value", ) @@ -2813,7 +2813,7 @@ def sample_check_consistency(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.CheckConsistencyRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.CheckConsistencyRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] name (str): @@ -2840,7 +2840,7 @@ def sample_check_consistency(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.CheckConsistencyResponse: + google.cloud.bigtable.admin.types.CheckConsistencyResponse: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] @@ -2927,14 +2927,14 @@ def snapshot_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_snapshot_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.SnapshotTableRequest( + request = admin.SnapshotTableRequest( name="name_value", cluster="cluster_value", snapshot_id="snapshot_id_value", @@ -2951,7 +2951,7 @@ def sample_snapshot_table(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.SnapshotTableRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.SnapshotTableRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable] @@ -3004,7 +3004,7 @@ def sample_snapshot_table(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Snapshot` A snapshot of a table at a particular time. A snapshot can be used as a + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Snapshot` A snapshot of a table at a particular time. A snapshot can be used as a checkpoint for data restoration or a data source for a new table. @@ -3103,14 +3103,14 @@ def get_snapshot( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_get_snapshot(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetSnapshotRequest( + request = admin.GetSnapshotRequest( name="name_value", ) @@ -3121,7 +3121,7 @@ def sample_get_snapshot(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetSnapshotRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.GetSnapshotRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot] @@ -3148,7 +3148,7 @@ def sample_get_snapshot(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Snapshot: + google.cloud.bigtable.admin.types.Snapshot: A snapshot of a table at a particular time. A snapshot can be used as a checkpoint for data restoration or a @@ -3239,14 +3239,14 @@ def list_snapshots( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_list_snapshots(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListSnapshotsRequest( + request = admin.ListSnapshotsRequest( parent="parent_value", ) @@ -3258,7 +3258,7 @@ def sample_list_snapshots(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListSnapshotsRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.ListSnapshotsRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] @@ -3288,7 +3288,7 @@ def sample_list_snapshots(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListSnapshotsPager: + google.cloud.bigtable.admin.services.bigtable_table_admin.pagers.ListSnapshotsPager: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] @@ -3389,14 +3389,14 @@ def delete_snapshot( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_delete_snapshot(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteSnapshotRequest( + request = admin.DeleteSnapshotRequest( name="name_value", ) @@ -3404,7 +3404,7 @@ def sample_delete_snapshot(): client.delete_snapshot(request=request) Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteSnapshotRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.DeleteSnapshotRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot] @@ -3503,17 +3503,17 @@ def create_backup( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_create_backup(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - backup = bigtable_admin_v2.Backup() + backup = admin.Backup() backup.source_table = "source_table_value" - request = bigtable_admin_v2.CreateBackupRequest( + request = admin.CreateBackupRequest( parent="parent_value", backup_id="backup_id_value", backup=backup, @@ -3530,7 +3530,7 @@ def sample_create_backup(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateBackupRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.CreateBackupRequest, dict]): The request object. The request for [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]. parent (str): @@ -3549,12 +3549,12 @@ def sample_create_backup(): full backup name, of the form: ``projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}``. This string must be between 1 and 50 characters in - length and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]*. + length and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]\*. This corresponds to the ``backup_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - backup (google.cloud.bigtable_admin_v2.types.Backup): + backup (google.cloud.bigtable.admin.types.Backup): Required. The backup to create. This corresponds to the ``backup`` field on the ``request`` instance; if ``request`` is provided, this @@ -3572,7 +3572,7 @@ def sample_create_backup(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.Backup` A + :class:`google.cloud.bigtable.admin.types.Backup` A backup of a Cloud Bigtable table. """ @@ -3655,14 +3655,14 @@ def get_backup( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_get_backup(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetBackupRequest( + request = admin.GetBackupRequest( name="name_value", ) @@ -3673,7 +3673,7 @@ def sample_get_backup(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetBackupRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.GetBackupRequest, dict]): The request object. The request for [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup]. name (str): @@ -3692,7 +3692,7 @@ def sample_get_backup(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Backup: + google.cloud.bigtable.admin.types.Backup: A backup of a Cloud Bigtable table. """ # Create or coerce a protobuf request object. @@ -3762,17 +3762,17 @@ def update_backup( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_update_backup(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - backup = bigtable_admin_v2.Backup() + backup = admin.Backup() backup.source_table = "source_table_value" - request = bigtable_admin_v2.UpdateBackupRequest( + request = admin.UpdateBackupRequest( backup=backup, ) @@ -3783,16 +3783,16 @@ def sample_update_backup(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateBackupRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.UpdateBackupRequest, dict]): The request object. The request for [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup]. - backup (google.cloud.bigtable_admin_v2.types.Backup): + backup (google.cloud.bigtable.admin.types.Backup): Required. The backup to update. ``backup.name``, and the fields to be updated as specified by ``update_mask`` are required. Other fields are ignored. Update is only supported for the following fields: - - ``backup.expire_time``. + - ``backup.expire_time``. This corresponds to the ``backup`` field on the ``request`` instance; if ``request`` is provided, this @@ -3818,7 +3818,7 @@ def sample_update_backup(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Backup: + google.cloud.bigtable.admin.types.Backup: A backup of a Cloud Bigtable table. """ # Create or coerce a protobuf request object. @@ -3891,14 +3891,14 @@ def delete_backup( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_delete_backup(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteBackupRequest( + request = admin.DeleteBackupRequest( name="name_value", ) @@ -3906,7 +3906,7 @@ def sample_delete_backup(): client.delete_backup(request=request) Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteBackupRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.DeleteBackupRequest, dict]): The request object. The request for [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup]. name (str): @@ -3989,14 +3989,14 @@ def list_backups( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_list_backups(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListBackupsRequest( + request = admin.ListBackupsRequest( parent="parent_value", ) @@ -4008,7 +4008,7 @@ def sample_list_backups(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListBackupsRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.ListBackupsRequest, dict]): The request object. The request for [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. parent (str): @@ -4031,7 +4031,7 @@ def sample_list_backups(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListBackupsPager: + google.cloud.bigtable.admin.services.bigtable_table_admin.pagers.ListBackupsPager: The response for [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. @@ -4122,14 +4122,14 @@ def _restore_table( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_restore_table(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.RestoreTableRequest( + request = admin.RestoreTableRequest( backup="backup_value", parent="parent_value", table_id="table_id_value", @@ -4146,7 +4146,7 @@ def sample_restore_table(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.RestoreTableRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.RestoreTableRequest, dict]): The request object. The request for [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -4161,7 +4161,7 @@ def sample_restore_table(): google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp. + The result type for the operation will be :class:`google.cloud.bigtable.admin.types.Table` A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster. @@ -4229,14 +4229,14 @@ def copy_backup( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_copy_backup(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.CopyBackupRequest( + request = admin.CopyBackupRequest( parent="parent_value", backup_id="backup_id_value", source_backup="source_backup_value", @@ -4253,7 +4253,7 @@ def sample_copy_backup(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.CopyBackupRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.CopyBackupRequest, dict]): The request object. The request for [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]. parent (str): @@ -4272,7 +4272,7 @@ def sample_copy_backup(): name, of the form: ``projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}``. This string must be between 1 and 50 characters in - length and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]*. + length and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]\*. This corresponds to the ``backup_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -4313,7 +4313,7 @@ def sample_copy_backup(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.Backup` A + :class:`google.cloud.bigtable.admin.types.Backup` A backup of a Cloud Bigtable table. """ @@ -4399,12 +4399,12 @@ def get_iam_policy( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -4456,19 +4456,19 @@ def sample_get_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -4539,12 +4539,12 @@ def set_iam_policy( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -4596,19 +4596,19 @@ def sample_set_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -4680,12 +4680,12 @@ def test_iam_permissions( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -4805,17 +4805,17 @@ def create_schema_bundle( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_create_schema_bundle(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - schema_bundle = bigtable_admin_v2.SchemaBundle() + schema_bundle = admin.SchemaBundle() schema_bundle.proto_schema.proto_descriptors = b'proto_descriptors_blob' - request = bigtable_admin_v2.CreateSchemaBundleRequest( + request = admin.CreateSchemaBundleRequest( parent="parent_value", schema_bundle_id="schema_bundle_id_value", schema_bundle=schema_bundle, @@ -4832,7 +4832,7 @@ def sample_create_schema_bundle(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateSchemaBundleRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.CreateSchemaBundleRequest, dict]): The request object. The request for [CreateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.CreateSchemaBundle]. parent (str): @@ -4852,7 +4852,7 @@ def sample_create_schema_bundle(): This corresponds to the ``schema_bundle_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - schema_bundle (google.cloud.bigtable_admin_v2.types.SchemaBundle): + schema_bundle (google.cloud.bigtable.admin.types.SchemaBundle): Required. The schema bundle to create. @@ -4872,7 +4872,7 @@ def sample_create_schema_bundle(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.SchemaBundle` + :class:`google.cloud.bigtable.admin.types.SchemaBundle` A named collection of related schemas. """ @@ -4957,17 +4957,17 @@ def update_schema_bundle( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_update_schema_bundle(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - schema_bundle = bigtable_admin_v2.SchemaBundle() + schema_bundle = admin.SchemaBundle() schema_bundle.proto_schema.proto_descriptors = b'proto_descriptors_blob' - request = bigtable_admin_v2.UpdateSchemaBundleRequest( + request = admin.UpdateSchemaBundleRequest( schema_bundle=schema_bundle, ) @@ -4982,10 +4982,10 @@ def sample_update_schema_bundle(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateSchemaBundleRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.UpdateSchemaBundleRequest, dict]): The request object. The request for [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle]. - schema_bundle (google.cloud.bigtable_admin_v2.types.SchemaBundle): + schema_bundle (google.cloud.bigtable.admin.types.SchemaBundle): Required. The schema bundle to update. The schema bundle's ``name`` field is used to identify @@ -5015,7 +5015,7 @@ def sample_update_schema_bundle(): An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.SchemaBundle` + :class:`google.cloud.bigtable.admin.types.SchemaBundle` A named collection of related schemas. """ @@ -5100,14 +5100,14 @@ def get_schema_bundle( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_get_schema_bundle(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.GetSchemaBundleRequest( + request = admin.GetSchemaBundleRequest( name="name_value", ) @@ -5118,7 +5118,7 @@ def sample_get_schema_bundle(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetSchemaBundleRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.GetSchemaBundleRequest, dict]): The request object. The request for [GetSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.GetSchemaBundle]. name (str): @@ -5138,7 +5138,7 @@ def sample_get_schema_bundle(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.SchemaBundle: + google.cloud.bigtable.admin.types.SchemaBundle: A named collection of related schemas. @@ -5212,14 +5212,14 @@ def list_schema_bundles( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_list_schema_bundles(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.ListSchemaBundlesRequest( + request = admin.ListSchemaBundlesRequest( parent="parent_value", ) @@ -5231,7 +5231,7 @@ def sample_list_schema_bundles(): print(response) Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListSchemaBundlesRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.ListSchemaBundlesRequest, dict]): The request object. The request for [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]. parent (str): @@ -5251,7 +5251,7 @@ def sample_list_schema_bundles(): be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListSchemaBundlesPager: + google.cloud.bigtable.admin.services.bigtable_table_admin.pagers.ListSchemaBundlesPager: The response for [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]. @@ -5338,14 +5338,14 @@ def delete_schema_bundle( # - It may require specifying regional endpoints when creating the service # client as shown in: # https://googleapis.dev/python/google-api-core/latest/client_options.html - from google.cloud import bigtable_admin_v2 + from google.cloud.bigtable import admin def sample_delete_schema_bundle(): # Create a client - client = bigtable_admin_v2.BigtableTableAdminClient() + client = admin.BigtableTableAdminClient() # Initialize request argument(s) - request = bigtable_admin_v2.DeleteSchemaBundleRequest( + request = admin.DeleteSchemaBundleRequest( name="name_value", ) @@ -5353,7 +5353,7 @@ def sample_delete_schema_bundle(): client.delete_schema_bundle(request=request) Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteSchemaBundleRequest, dict]): + request (Union[google.cloud.bigtable.admin.types.DeleteSchemaBundleRequest, dict]): The request object. The request for [DeleteSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSchemaBundle]. name (str): diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/pagers.py b/google/cloud/bigtable/admin/services/bigtable_table_admin/pagers.py similarity index 89% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/pagers.py rename to google/cloud/bigtable/admin/services/bigtable_table_admin/pagers.py index e6d83ba63..2e668e1d3 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/pagers.py +++ b/google/cloud/bigtable/admin/services/bigtable_table_admin/pagers.py @@ -37,15 +37,15 @@ OptionalRetry = Union[retries.Retry, object, None] # type: ignore OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table +from google.cloud.bigtable.admin.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import table class ListTablesPager: """A pager for iterating through ``list_tables`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListTablesResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListTablesResponse` object, and provides an ``__iter__`` method to iterate through its ``tables`` field. @@ -54,7 +54,7 @@ class ListTablesPager: through the ``tables`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListTablesResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListTablesResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -74,9 +74,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListTablesRequest): + request (google.cloud.bigtable.admin.types.ListTablesRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListTablesResponse): + response (google.cloud.bigtable.admin.types.ListTablesResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -121,7 +121,7 @@ class ListTablesAsyncPager: """A pager for iterating through ``list_tables`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListTablesResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListTablesResponse` object, and provides an ``__aiter__`` method to iterate through its ``tables`` field. @@ -130,7 +130,7 @@ class ListTablesAsyncPager: through the ``tables`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListTablesResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListTablesResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -150,9 +150,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListTablesRequest): + request (google.cloud.bigtable.admin.types.ListTablesRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListTablesResponse): + response (google.cloud.bigtable.admin.types.ListTablesResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -201,7 +201,7 @@ class ListAuthorizedViewsPager: """A pager for iterating through ``list_authorized_views`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListAuthorizedViewsResponse` object, and provides an ``__iter__`` method to iterate through its ``authorized_views`` field. @@ -210,7 +210,7 @@ class ListAuthorizedViewsPager: through the ``authorized_views`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListAuthorizedViewsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -230,9 +230,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsRequest): + request (google.cloud.bigtable.admin.types.ListAuthorizedViewsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsResponse): + response (google.cloud.bigtable.admin.types.ListAuthorizedViewsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -277,7 +277,7 @@ class ListAuthorizedViewsAsyncPager: """A pager for iterating through ``list_authorized_views`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListAuthorizedViewsResponse` object, and provides an ``__aiter__`` method to iterate through its ``authorized_views`` field. @@ -286,7 +286,7 @@ class ListAuthorizedViewsAsyncPager: through the ``authorized_views`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListAuthorizedViewsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -308,9 +308,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsRequest): + request (google.cloud.bigtable.admin.types.ListAuthorizedViewsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsResponse): + response (google.cloud.bigtable.admin.types.ListAuthorizedViewsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -361,7 +361,7 @@ class ListSnapshotsPager: """A pager for iterating through ``list_snapshots`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListSnapshotsResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListSnapshotsResponse` object, and provides an ``__iter__`` method to iterate through its ``snapshots`` field. @@ -370,7 +370,7 @@ class ListSnapshotsPager: through the ``snapshots`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListSnapshotsResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListSnapshotsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -390,9 +390,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListSnapshotsRequest): + request (google.cloud.bigtable.admin.types.ListSnapshotsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListSnapshotsResponse): + response (google.cloud.bigtable.admin.types.ListSnapshotsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -437,7 +437,7 @@ class ListSnapshotsAsyncPager: """A pager for iterating through ``list_snapshots`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListSnapshotsResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListSnapshotsResponse` object, and provides an ``__aiter__`` method to iterate through its ``snapshots`` field. @@ -446,7 +446,7 @@ class ListSnapshotsAsyncPager: through the ``snapshots`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListSnapshotsResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListSnapshotsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -466,9 +466,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListSnapshotsRequest): + request (google.cloud.bigtable.admin.types.ListSnapshotsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListSnapshotsResponse): + response (google.cloud.bigtable.admin.types.ListSnapshotsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -517,7 +517,7 @@ class ListBackupsPager: """A pager for iterating through ``list_backups`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListBackupsResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListBackupsResponse` object, and provides an ``__iter__`` method to iterate through its ``backups`` field. @@ -526,7 +526,7 @@ class ListBackupsPager: through the ``backups`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListBackupsResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListBackupsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -546,9 +546,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListBackupsRequest): + request (google.cloud.bigtable.admin.types.ListBackupsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListBackupsResponse): + response (google.cloud.bigtable.admin.types.ListBackupsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -593,7 +593,7 @@ class ListBackupsAsyncPager: """A pager for iterating through ``list_backups`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListBackupsResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListBackupsResponse` object, and provides an ``__aiter__`` method to iterate through its ``backups`` field. @@ -602,7 +602,7 @@ class ListBackupsAsyncPager: through the ``backups`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListBackupsResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListBackupsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -622,9 +622,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListBackupsRequest): + request (google.cloud.bigtable.admin.types.ListBackupsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListBackupsResponse): + response (google.cloud.bigtable.admin.types.ListBackupsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -673,7 +673,7 @@ class ListSchemaBundlesPager: """A pager for iterating through ``list_schema_bundles`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListSchemaBundlesResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListSchemaBundlesResponse` object, and provides an ``__iter__`` method to iterate through its ``schema_bundles`` field. @@ -682,7 +682,7 @@ class ListSchemaBundlesPager: through the ``schema_bundles`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListSchemaBundlesResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListSchemaBundlesResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -702,9 +702,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListSchemaBundlesRequest): + request (google.cloud.bigtable.admin.types.ListSchemaBundlesRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListSchemaBundlesResponse): + response (google.cloud.bigtable.admin.types.ListSchemaBundlesResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -749,7 +749,7 @@ class ListSchemaBundlesAsyncPager: """A pager for iterating through ``list_schema_bundles`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListSchemaBundlesResponse` object, and + :class:`google.cloud.bigtable.admin.types.ListSchemaBundlesResponse` object, and provides an ``__aiter__`` method to iterate through its ``schema_bundles`` field. @@ -758,7 +758,7 @@ class ListSchemaBundlesAsyncPager: through the ``schema_bundles`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListSchemaBundlesResponse` + All the usual :class:`google.cloud.bigtable.admin.types.ListSchemaBundlesResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -780,9 +780,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListSchemaBundlesRequest): + request (google.cloud.bigtable.admin.types.ListSchemaBundlesRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListSchemaBundlesResponse): + response (google.cloud.bigtable.admin.types.ListSchemaBundlesResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/README.rst b/google/cloud/bigtable/admin/services/bigtable_table_admin/transports/README.rst similarity index 100% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/README.rst rename to google/cloud/bigtable/admin/services/bigtable_table_admin/transports/README.rst diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/__init__.py b/google/cloud/bigtable/admin/services/bigtable_table_admin/transports/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/__init__.py rename to google/cloud/bigtable/admin/services/bigtable_table_admin/transports/__init__.py diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py b/google/cloud/bigtable/admin/services/bigtable_table_admin/transports/base.py similarity index 98% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py rename to google/cloud/bigtable/admin/services/bigtable_table_admin/transports/base.py index 8e2cb7304..91ca222e9 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py +++ b/google/cloud/bigtable/admin/services/bigtable_table_admin/transports/base.py @@ -16,7 +16,7 @@ import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -28,9 +28,9 @@ from google.oauth2 import service_account # type: ignore import google.protobuf -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table +from google.cloud.bigtable.admin.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import table +from google.cloud.bigtable.admin.types import table as gba_table from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -81,9 +81,10 @@ def __init__( credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment. - credentials_file (Optional[str]): A file with credentials that can + credentials_file (Optional[str]): Deprecated. A file with credentials that can be loaded with :func:`google.auth.load_credentials_from_file`. - This argument is mutually exclusive with credentials. + This argument is mutually exclusive with credentials. This argument will be + removed in the next major version of this library. scopes (Optional[Sequence[str]]): A list of scopes. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc.py b/google/cloud/bigtable/admin/services/bigtable_table_admin/transports/grpc.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc.py rename to google/cloud/bigtable/admin/services/bigtable_table_admin/transports/grpc.py index 5f46c3aa3..20a0d6d98 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc.py +++ b/google/cloud/bigtable/admin/services/bigtable_table_admin/transports/grpc.py @@ -31,9 +31,9 @@ import grpc # type: ignore import proto # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table +from google.cloud.bigtable.admin.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import table +from google.cloud.bigtable.admin.types import table as gba_table from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -162,9 +162,10 @@ def __init__( are specified, the client will attempt to ascertain the credentials from the environment. This argument is ignored if a ``channel`` instance is provided. - credentials_file (Optional[str]): A file with credentials that can + credentials_file (Optional[str]): Deprecated. A file with credentials that can be loaded with :func:`google.auth.load_credentials_from_file`. This argument is ignored if a ``channel`` instance is provided. + This argument will be removed in the next major version of this library. scopes (Optional(Sequence[str])): A list of scopes. This argument is ignored if a ``channel`` instance is provided. channel (Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]]): @@ -298,9 +299,10 @@ def create_channel( credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. - credentials_file (Optional[str]): A file with credentials that can + credentials_file (Optional[str]): Deprecated. A file with credentials that can be loaded with :func:`google.auth.load_credentials_from_file`. - This argument is mutually exclusive with credentials. + This argument is mutually exclusive with credentials. This argument will be + removed in the next major version of this library. scopes (Optional[Sequence[str]]): A optional list of scopes needed for this service. These are only used when credentials are not specified and are passed to :func:`google.auth.default`. diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py b/google/cloud/bigtable/admin/services/bigtable_table_admin/transports/grpc_asyncio.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py rename to google/cloud/bigtable/admin/services/bigtable_table_admin/transports/grpc_asyncio.py index 159a96eda..34d269735 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py +++ b/google/cloud/bigtable/admin/services/bigtable_table_admin/transports/grpc_asyncio.py @@ -34,9 +34,9 @@ import proto # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table +from google.cloud.bigtable.admin.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import table +from google.cloud.bigtable.admin.types import table as gba_table from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -159,8 +159,9 @@ def create_channel( credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. - credentials_file (Optional[str]): A file with credentials that can - be loaded with :func:`google.auth.load_credentials_from_file`. + credentials_file (Optional[str]): Deprecated. A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. This argument will be + removed in the next major version of this library. scopes (Optional[Sequence[str]]): A optional list of scopes needed for this service. These are only used when credentials are not specified and are passed to :func:`google.auth.default`. @@ -211,9 +212,10 @@ def __init__( are specified, the client will attempt to ascertain the credentials from the environment. This argument is ignored if a ``channel`` instance is provided. - credentials_file (Optional[str]): A file with credentials that can + credentials_file (Optional[str]): Deprecated. A file with credentials that can be loaded with :func:`google.auth.load_credentials_from_file`. This argument is ignored if a ``channel`` instance is provided. + This argument will be removed in the next major version of this library. scopes (Optional[Sequence[str]]): A optional list of scopes needed for this service. These are only used when credentials are not specified and are passed to :func:`google.auth.default`. diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest.py b/google/cloud/bigtable/admin/services/bigtable_table_admin/transports/rest.py similarity index 98% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest.py rename to google/cloud/bigtable/admin/services/bigtable_table_admin/transports/rest.py index ec2462d4a..4d9d460fe 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest.py +++ b/google/cloud/bigtable/admin/services/bigtable_table_admin/transports/rest.py @@ -34,9 +34,9 @@ import warnings -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table +from google.cloud.bigtable.admin.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import table +from google.cloud.bigtable.admin.types import table as gba_table from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore @@ -1896,9 +1896,10 @@ def __init__( are specified, the client will attempt to ascertain the credentials from the environment. - credentials_file (Optional[str]): A file with credentials that can + credentials_file (Optional[str]): Deprecated. A file with credentials that can be loaded with :func:`google.auth.load_credentials_from_file`. - This argument is ignored if ``channel`` is provided. + This argument is ignored if ``channel`` is provided. This argument will be + removed in the next major version of this library. scopes (Optional(Sequence[str])): A list of scopes. This argument is ignored if ``channel`` is provided. client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client @@ -2087,7 +2088,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CheckConsistency", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.CheckConsistency", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CheckConsistency", @@ -2138,7 +2139,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.check_consistency", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.check_consistency", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CheckConsistency", @@ -2243,7 +2244,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CopyBackup", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.CopyBackup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CopyBackup", @@ -2290,7 +2291,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.copy_backup", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.copy_backup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CopyBackup", @@ -2398,7 +2399,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CreateAuthorizedView", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.CreateAuthorizedView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateAuthorizedView", @@ -2447,7 +2448,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.create_authorized_view", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.create_authorized_view", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateAuthorizedView", @@ -2553,7 +2554,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CreateBackup", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.CreateBackup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateBackup", @@ -2600,7 +2601,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.create_backup", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.create_backup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateBackup", @@ -2708,7 +2709,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CreateSchemaBundle", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.CreateSchemaBundle", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateSchemaBundle", @@ -2757,7 +2758,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.create_schema_bundle", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.create_schema_bundle", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateSchemaBundle", @@ -2864,7 +2865,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CreateTable", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.CreateTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateTable", @@ -2913,7 +2914,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.create_table", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.create_table", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateTable", @@ -3029,7 +3030,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CreateTableFromSnapshot", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.CreateTableFromSnapshot", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateTableFromSnapshot", @@ -3078,7 +3079,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.create_table_from_snapshot", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.create_table_from_snapshot", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateTableFromSnapshot", @@ -3174,7 +3175,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.DeleteAuthorizedView", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.DeleteAuthorizedView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "DeleteAuthorizedView", @@ -3284,7 +3285,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.DeleteBackup", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.DeleteBackup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "DeleteBackup", @@ -3394,7 +3395,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.DeleteSchemaBundle", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.DeleteSchemaBundle", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "DeleteSchemaBundle", @@ -3511,7 +3512,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.DeleteSnapshot", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.DeleteSnapshot", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "DeleteSnapshot", @@ -3619,7 +3620,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.DeleteTable", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.DeleteTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "DeleteTable", @@ -3732,7 +3733,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.DropRowRange", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.DropRowRange", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "DropRowRange", @@ -3855,7 +3856,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GenerateConsistencyToken", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.GenerateConsistencyToken", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GenerateConsistencyToken", @@ -3910,7 +3911,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.generate_consistency_token", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.generate_consistency_token", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GenerateConsistencyToken", @@ -4016,7 +4017,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GetAuthorizedView", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.GetAuthorizedView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetAuthorizedView", @@ -4064,7 +4065,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.get_authorized_view", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.get_authorized_view", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetAuthorizedView", @@ -4161,7 +4162,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GetBackup", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.GetBackup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetBackup", @@ -4209,7 +4210,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.get_backup", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.get_backup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetBackup", @@ -4386,7 +4387,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GetIamPolicy", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.GetIamPolicy", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetIamPolicy", @@ -4435,7 +4436,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.get_iam_policy", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.get_iam_policy", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetIamPolicy", @@ -4537,7 +4538,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GetSchemaBundle", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.GetSchemaBundle", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetSchemaBundle", @@ -4585,7 +4586,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.get_schema_bundle", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.get_schema_bundle", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetSchemaBundle", @@ -4703,7 +4704,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GetSnapshot", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.GetSnapshot", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetSnapshot", @@ -4751,7 +4752,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.get_snapshot", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.get_snapshot", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetSnapshot", @@ -4852,7 +4853,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GetTable", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.GetTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetTable", @@ -4900,7 +4901,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.get_table", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.get_table", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetTable", @@ -5002,7 +5003,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.ListAuthorizedViews", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.ListAuthorizedViews", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListAuthorizedViews", @@ -5056,7 +5057,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.list_authorized_views", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.list_authorized_views", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListAuthorizedViews", @@ -5156,7 +5157,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.ListBackups", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.ListBackups", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListBackups", @@ -5206,7 +5207,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.list_backups", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.list_backups", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListBackups", @@ -5308,7 +5309,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.ListSchemaBundles", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.ListSchemaBundles", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListSchemaBundles", @@ -5358,7 +5359,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.list_schema_bundles", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.list_schema_bundles", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListSchemaBundles", @@ -5472,7 +5473,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.ListSnapshots", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.ListSnapshots", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListSnapshots", @@ -5522,7 +5523,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.list_snapshots", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.list_snapshots", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListSnapshots", @@ -5621,7 +5622,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.ListTables", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.ListTables", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListTables", @@ -5671,7 +5672,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.list_tables", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.list_tables", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListTables", @@ -5780,7 +5781,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.ModifyColumnFamilies", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.ModifyColumnFamilies", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ModifyColumnFamilies", @@ -5831,7 +5832,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.modify_column_families", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.modify_column_families", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ModifyColumnFamilies", @@ -5937,7 +5938,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.RestoreTable", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.RestoreTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "RestoreTable", @@ -5984,7 +5985,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.restore_table", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.restore_table", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "RestoreTable", @@ -6161,7 +6162,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.SetIamPolicy", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.SetIamPolicy", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "SetIamPolicy", @@ -6210,7 +6211,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.set_iam_policy", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.set_iam_policy", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "SetIamPolicy", @@ -6323,7 +6324,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.SnapshotTable", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.SnapshotTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "SnapshotTable", @@ -6370,7 +6371,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.snapshot_table", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.snapshot_table", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "SnapshotTable", @@ -6474,7 +6475,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.TestIamPermissions", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.TestIamPermissions", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "TestIamPermissions", @@ -6525,7 +6526,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.test_iam_permissions", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.test_iam_permissions", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "TestIamPermissions", @@ -6631,7 +6632,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.UndeleteTable", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.UndeleteTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UndeleteTable", @@ -6678,7 +6679,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.undelete_table", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.undelete_table", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UndeleteTable", @@ -6786,7 +6787,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.UpdateAuthorizedView", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.UpdateAuthorizedView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateAuthorizedView", @@ -6835,7 +6836,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.update_authorized_view", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.update_authorized_view", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateAuthorizedView", @@ -6938,7 +6939,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.UpdateBackup", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.UpdateBackup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateBackup", @@ -6987,7 +6988,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.update_backup", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.update_backup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateBackup", @@ -7095,7 +7096,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.UpdateSchemaBundle", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.UpdateSchemaBundle", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateSchemaBundle", @@ -7144,7 +7145,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.update_schema_bundle", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.update_schema_bundle", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateSchemaBundle", @@ -7250,7 +7251,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.UpdateTable", + f"Sending request for google.bigtable.admin.BaseBigtableTableAdminClient.UpdateTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateTable", @@ -7297,7 +7298,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.update_table", + "Received response for google.bigtable.admin.BaseBigtableTableAdminClient.update_table", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateTable", diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest_base.py b/google/cloud/bigtable/admin/services/bigtable_table_admin/transports/rest_base.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest_base.py rename to google/cloud/bigtable/admin/services/bigtable_table_admin/transports/rest_base.py index ef6c2374d..adab2adca 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest_base.py +++ b/google/cloud/bigtable/admin/services/bigtable_table_admin/transports/rest_base.py @@ -24,9 +24,9 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table +from google.cloud.bigtable.admin.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import table +from google.cloud.bigtable.admin.types import table as gba_table from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore diff --git a/google/cloud/bigtable_admin_v2/types/__init__.py b/google/cloud/bigtable/admin/types/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/types/__init__.py rename to google/cloud/bigtable/admin/types/__init__.py diff --git a/google/cloud/bigtable_admin_v2/types/bigtable_instance_admin.py b/google/cloud/bigtable/admin/types/bigtable_instance_admin.py similarity index 94% rename from google/cloud/bigtable_admin_v2/types/bigtable_instance_admin.py rename to google/cloud/bigtable/admin/types/bigtable_instance_admin.py index 4197ed0b7..d2a7f4ad9 100644 --- a/google/cloud/bigtable_admin_v2/types/bigtable_instance_admin.py +++ b/google/cloud/bigtable/admin/types/bigtable_instance_admin.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.cloud.bigtable_admin_v2.types import instance as gba_instance +from google.cloud.bigtable.admin.types import instance as gba_instance from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -85,10 +85,10 @@ class CreateInstanceRequest(proto.Message): Required. The ID to be used when referring to the new instance within its project, e.g., just ``myinstance`` rather than ``projects/myproject/instances/myinstance``. - instance (google.cloud.bigtable_admin_v2.types.Instance): + instance (google.cloud.bigtable.admin.types.Instance): Required. The instance to create. Fields marked ``OutputOnly`` must be left blank. - clusters (MutableMapping[str, google.cloud.bigtable_admin_v2.types.Cluster]): + clusters (MutableMapping[str, google.cloud.bigtable.admin.types.Cluster]): Required. The clusters to be created within the instance, mapped by desired cluster ID, e.g., just ``mycluster`` rather than @@ -158,7 +158,7 @@ class ListInstancesResponse(proto.Message): r"""Response message for BigtableInstanceAdmin.ListInstances. Attributes: - instances (MutableSequence[google.cloud.bigtable_admin_v2.types.Instance]): + instances (MutableSequence[google.cloud.bigtable.admin.types.Instance]): The list of requested instances. failed_locations (MutableSequence[str]): Locations from which Instance information could not be @@ -196,7 +196,7 @@ class PartialUpdateInstanceRequest(proto.Message): BigtableInstanceAdmin.PartialUpdateInstance. Attributes: - instance (google.cloud.bigtable_admin_v2.types.Instance): + instance (google.cloud.bigtable.admin.types.Instance): Required. The Instance which will (partially) replace the current value. update_mask (google.protobuf.field_mask_pb2.FieldMask): @@ -245,7 +245,7 @@ class CreateClusterRequest(proto.Message): cluster within its instance, e.g., just ``mycluster`` rather than ``projects/myproject/instances/myinstance/clusters/mycluster``. - cluster (google.cloud.bigtable_admin_v2.types.Cluster): + cluster (google.cloud.bigtable.admin.types.Cluster): Required. The cluster to be created. Fields marked ``OutputOnly`` must be left blank. """ @@ -309,7 +309,7 @@ class ListClustersResponse(proto.Message): r"""Response message for BigtableInstanceAdmin.ListClusters. Attributes: - clusters (MutableSequence[google.cloud.bigtable_admin_v2.types.Cluster]): + clusters (MutableSequence[google.cloud.bigtable.admin.types.Cluster]): The list of requested clusters. failed_locations (MutableSequence[str]): Locations from which Cluster information could not be @@ -361,7 +361,7 @@ class CreateInstanceMetadata(proto.Message): r"""The metadata for the Operation returned by CreateInstance. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.CreateInstanceRequest): + original_request (google.cloud.bigtable.admin.types.CreateInstanceRequest): The request that prompted the initiation of this CreateInstance operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -393,7 +393,7 @@ class UpdateInstanceMetadata(proto.Message): r"""The metadata for the Operation returned by UpdateInstance. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.PartialUpdateInstanceRequest): + original_request (google.cloud.bigtable.admin.types.PartialUpdateInstanceRequest): The request that prompted the initiation of this UpdateInstance operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -425,7 +425,7 @@ class CreateClusterMetadata(proto.Message): r"""The metadata for the Operation returned by CreateCluster. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.CreateClusterRequest): + original_request (google.cloud.bigtable.admin.types.CreateClusterRequest): The request that prompted the initiation of this CreateCluster operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -434,7 +434,7 @@ class CreateClusterMetadata(proto.Message): finish_time (google.protobuf.timestamp_pb2.Timestamp): The time at which the operation failed or was completed successfully. - tables (MutableMapping[str, google.cloud.bigtable_admin_v2.types.CreateClusterMetadata.TableProgress]): + tables (MutableMapping[str, google.cloud.bigtable.admin.types.CreateClusterMetadata.TableProgress]): Keys: the full ``name`` of each table that existed in the instance when CreateCluster was first called, i.e. ``projects//instances//tables/``. @@ -456,7 +456,7 @@ class TableProgress(proto.Message): Estimate of the number of bytes copied so far for this table. This will eventually reach 'estimated_size_bytes' unless the table copy is CANCELLED. - state (google.cloud.bigtable_admin_v2.types.CreateClusterMetadata.TableProgress.State): + state (google.cloud.bigtable.admin.types.CreateClusterMetadata.TableProgress.State): """ @@ -528,7 +528,7 @@ class UpdateClusterMetadata(proto.Message): r"""The metadata for the Operation returned by UpdateCluster. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.Cluster): + original_request (google.cloud.bigtable.admin.types.Cluster): The request that prompted the initiation of this UpdateCluster operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -567,7 +567,7 @@ class PartialUpdateClusterMetadata(proto.Message): finish_time (google.protobuf.timestamp_pb2.Timestamp): The time at which the operation failed or was completed successfully. - original_request (google.cloud.bigtable_admin_v2.types.PartialUpdateClusterRequest): + original_request (google.cloud.bigtable.admin.types.PartialUpdateClusterRequest): The original request for PartialUpdateCluster. """ @@ -594,7 +594,7 @@ class PartialUpdateClusterRequest(proto.Message): BigtableInstanceAdmin.PartialUpdateCluster. Attributes: - cluster (google.cloud.bigtable_admin_v2.types.Cluster): + cluster (google.cloud.bigtable.admin.types.Cluster): Required. The Cluster which contains the partial updates to be applied, subject to the update_mask. update_mask (google.protobuf.field_mask_pb2.FieldMask): @@ -627,7 +627,7 @@ class CreateAppProfileRequest(proto.Message): profile within its instance, e.g., just ``myprofile`` rather than ``projects/myproject/instances/myinstance/appProfiles/myprofile``. - app_profile (google.cloud.bigtable_admin_v2.types.AppProfile): + app_profile (google.cloud.bigtable.admin.types.AppProfile): Required. The app profile to be created. Fields marked ``OutputOnly`` will be ignored. ignore_warnings (bool): @@ -715,7 +715,7 @@ class ListAppProfilesResponse(proto.Message): r"""Response message for BigtableInstanceAdmin.ListAppProfiles. Attributes: - app_profiles (MutableSequence[google.cloud.bigtable_admin_v2.types.AppProfile]): + app_profiles (MutableSequence[google.cloud.bigtable.admin.types.AppProfile]): The list of requested app profiles. next_page_token (str): Set if not all app profiles could be returned in a single @@ -752,7 +752,7 @@ class UpdateAppProfileRequest(proto.Message): r"""Request message for BigtableInstanceAdmin.UpdateAppProfile. Attributes: - app_profile (google.cloud.bigtable_admin_v2.types.AppProfile): + app_profile (google.cloud.bigtable.admin.types.AppProfile): Required. The app profile which will (partially) replace the current value. update_mask (google.protobuf.field_mask_pb2.FieldMask): @@ -873,7 +873,7 @@ class ListHotTabletsResponse(proto.Message): r"""Response message for BigtableInstanceAdmin.ListHotTablets. Attributes: - hot_tablets (MutableSequence[google.cloud.bigtable_admin_v2.types.HotTablet]): + hot_tablets (MutableSequence[google.cloud.bigtable.admin.types.HotTablet]): List of hot tablets in the tables of the requested cluster that fall within the requested time range. Hot tablets are ordered by node cpu @@ -915,7 +915,7 @@ class CreateLogicalViewRequest(proto.Message): Required. The ID to use for the logical view, which will become the final component of the logical view's resource name. - logical_view (google.cloud.bigtable_admin_v2.types.LogicalView): + logical_view (google.cloud.bigtable.admin.types.LogicalView): Required. The logical view to create. """ @@ -938,7 +938,7 @@ class CreateLogicalViewMetadata(proto.Message): r"""The metadata for the Operation returned by CreateLogicalView. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.CreateLogicalViewRequest): + original_request (google.cloud.bigtable.admin.types.CreateLogicalViewRequest): The request that prompted the initiation of this CreateLogicalView operation. start_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1021,7 +1021,7 @@ class ListLogicalViewsResponse(proto.Message): r"""Response message for BigtableInstanceAdmin.ListLogicalViews. Attributes: - logical_views (MutableSequence[google.cloud.bigtable_admin_v2.types.LogicalView]): + logical_views (MutableSequence[google.cloud.bigtable.admin.types.LogicalView]): The list of requested logical views. next_page_token (str): A token, which can be sent as ``page_token`` to retrieve the @@ -1048,7 +1048,7 @@ class UpdateLogicalViewRequest(proto.Message): r"""Request message for BigtableInstanceAdmin.UpdateLogicalView. Attributes: - logical_view (google.cloud.bigtable_admin_v2.types.LogicalView): + logical_view (google.cloud.bigtable.admin.types.LogicalView): Required. The logical view to update. The logical view's ``name`` field is used to identify the @@ -1074,7 +1074,7 @@ class UpdateLogicalViewMetadata(proto.Message): r"""The metadata for the Operation returned by UpdateLogicalView. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.UpdateLogicalViewRequest): + original_request (google.cloud.bigtable.admin.types.UpdateLogicalViewRequest): The request that prompted the initiation of this UpdateLogicalView operation. start_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1140,7 +1140,7 @@ class CreateMaterializedViewRequest(proto.Message): Required. The ID to use for the materialized view, which will become the final component of the materialized view's resource name. - materialized_view (google.cloud.bigtable_admin_v2.types.MaterializedView): + materialized_view (google.cloud.bigtable.admin.types.MaterializedView): Required. The materialized view to create. """ @@ -1164,7 +1164,7 @@ class CreateMaterializedViewMetadata(proto.Message): CreateMaterializedView. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.CreateMaterializedViewRequest): + original_request (google.cloud.bigtable.admin.types.CreateMaterializedViewRequest): The request that prompted the initiation of this CreateMaterializedView operation. start_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1250,7 +1250,7 @@ class ListMaterializedViewsResponse(proto.Message): BigtableInstanceAdmin.ListMaterializedViews. Attributes: - materialized_views (MutableSequence[google.cloud.bigtable_admin_v2.types.MaterializedView]): + materialized_views (MutableSequence[google.cloud.bigtable.admin.types.MaterializedView]): The list of requested materialized views. next_page_token (str): A token, which can be sent as ``page_token`` to retrieve the @@ -1280,7 +1280,7 @@ class UpdateMaterializedViewRequest(proto.Message): BigtableInstanceAdmin.UpdateMaterializedView. Attributes: - materialized_view (google.cloud.bigtable_admin_v2.types.MaterializedView): + materialized_view (google.cloud.bigtable.admin.types.MaterializedView): Required. The materialized view to update. The materialized view's ``name`` field is used to identify @@ -1307,7 +1307,7 @@ class UpdateMaterializedViewMetadata(proto.Message): UpdateMaterializedView. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.UpdateMaterializedViewRequest): + original_request (google.cloud.bigtable.admin.types.UpdateMaterializedViewRequest): The request that prompted the initiation of this UpdateMaterializedView operation. start_time (google.protobuf.timestamp_pb2.Timestamp): diff --git a/google/cloud/bigtable_admin_v2/types/bigtable_table_admin.py b/google/cloud/bigtable/admin/types/bigtable_table_admin.py similarity index 92% rename from google/cloud/bigtable_admin_v2/types/bigtable_table_admin.py rename to google/cloud/bigtable/admin/types/bigtable_table_admin.py index d6403fc2a..82b564f1f 100644 --- a/google/cloud/bigtable_admin_v2/types/bigtable_table_admin.py +++ b/google/cloud/bigtable/admin/types/bigtable_table_admin.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.cloud.bigtable_admin_v2.types import common -from google.cloud.bigtable_admin_v2.types import table as gba_table +from google.cloud.bigtable.admin.types import common +from google.cloud.bigtable.admin.types import table as gba_table from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -137,9 +137,9 @@ class RestoreTableMetadata(proto.Message): name (str): Name of the table being created and restored to. - source_type (google.cloud.bigtable_admin_v2.types.RestoreSourceType): + source_type (google.cloud.bigtable.admin.types.RestoreSourceType): The type of the restore source. - backup_info (google.cloud.bigtable_admin_v2.types.BackupInfo): + backup_info (google.cloud.bigtable.admin.types.BackupInfo): This field is a member of `oneof`_ ``source_info``. optimize_table_operation_name (str): @@ -153,7 +153,7 @@ class RestoreTableMetadata(proto.Message): after the RestoreTable long-running operation completes successfully. This operation may not be created if the table is already optimized or the restore was not successful. - progress (google.cloud.bigtable_admin_v2.types.OperationProgress): + progress (google.cloud.bigtable.admin.types.OperationProgress): The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable] operation. @@ -195,7 +195,7 @@ class OptimizeRestoredTableMetadata(proto.Message): Attributes: name (str): Name of the restored table being optimized. - progress (google.cloud.bigtable_admin_v2.types.OperationProgress): + progress (google.cloud.bigtable.admin.types.OperationProgress): The progress of the post-restore optimizations. """ @@ -224,9 +224,9 @@ class CreateTableRequest(proto.Message): Required. The name by which the new table should be referred to within the parent instance, e.g., ``foobar`` rather than ``{parent}/tables/foobar``. Maximum 50 characters. - table (google.cloud.bigtable_admin_v2.types.Table): + table (google.cloud.bigtable.admin.types.Table): Required. The Table to create. - initial_splits (MutableSequence[google.cloud.bigtable_admin_v2.types.CreateTableRequest.Split]): + initial_splits (MutableSequence[google.cloud.bigtable.admin.types.CreateTableRequest.Split]): The optional list of row keys that will be used to initially split the table into several tablets (tablets are similar to HBase regions). Given two split keys, ``s1`` and ``s2``, @@ -235,20 +235,20 @@ class CreateTableRequest(proto.Message): Example: - - Row keys := - ``["a", "apple", "custom", "customer_1", "customer_2",`` - ``"other", "zz"]`` - - initial_split_keys := - ``["apple", "customer_1", "customer_2", "other"]`` - - Key assignment: - - - Tablet 1 ``[, apple) => {"a"}.`` - - Tablet 2 - ``[apple, customer_1) => {"apple", "custom"}.`` - - Tablet 3 - ``[customer_1, customer_2) => {"customer_1"}.`` - - Tablet 4 ``[customer_2, other) => {"customer_2"}.`` - - Tablet 5 ``[other, ) => {"other", "zz"}.`` + - Row keys := + ``["a", "apple", "custom", "customer_1", "customer_2",`` + ``"other", "zz"]`` + - initial_split_keys := + ``["apple", "customer_1", "customer_2", "other"]`` + - Key assignment: + + - Tablet 1 ``[, apple) => {"a"}.`` + - Tablet 2 + ``[apple, customer_1) => {"apple", "custom"}.`` + - Tablet 3 ``[customer_1, customer_2) => {"customer_1"}.`` + - Tablet 4 ``[customer_2, other) => {"customer_2"}.`` + - Tablet 5 + ``[other, ) => {"other", "zz"}.`` """ class Split(proto.Message): @@ -377,7 +377,7 @@ class ListTablesRequest(proto.Message): Required. The unique name of the instance for which tables should be listed. Values are of the form ``projects/{project}/instances/{instance}``. - view (google.cloud.bigtable_admin_v2.types.Table.View): + view (google.cloud.bigtable.admin.types.Table.View): The view to be applied to the returned tables' fields. NAME_ONLY view (default) and REPLICATION_VIEW are supported. page_size (int): @@ -421,7 +421,7 @@ class ListTablesResponse(proto.Message): [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] Attributes: - tables (MutableSequence[google.cloud.bigtable_admin_v2.types.Table]): + tables (MutableSequence[google.cloud.bigtable.admin.types.Table]): The tables present in the requested instance. next_page_token (str): Set if not all tables could be returned in a single @@ -453,7 +453,7 @@ class GetTableRequest(proto.Message): Required. The unique name of the requested table. Values are of the form ``projects/{project}/instances/{instance}/tables/{table}``. - view (google.cloud.bigtable_admin_v2.types.Table.View): + view (google.cloud.bigtable.admin.types.Table.View): The view to be applied to the returned table's fields. Defaults to ``SCHEMA_VIEW`` if unspecified. """ @@ -474,7 +474,7 @@ class UpdateTableRequest(proto.Message): [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]. Attributes: - table (google.cloud.bigtable_admin_v2.types.Table): + table (google.cloud.bigtable.admin.types.Table): Required. The table to update. The table's ``name`` field is used to identify the table to update. update_mask (google.protobuf.field_mask_pb2.FieldMask): @@ -482,13 +482,13 @@ class UpdateTableRequest(proto.Message): which fields (e.g. ``change_stream_config``) in the ``table`` field should be updated. This mask is relative to the ``table`` field, not to the request message. The - wildcard (*) path is currently not supported. Currently + wildcard (\*) path is currently not supported. Currently UpdateTable is only supported for the following fields: - - ``change_stream_config`` - - ``change_stream_config.retention_period`` - - ``deletion_protection`` - - ``row_key_schema`` + - ``change_stream_config`` + - ``change_stream_config.retention_period`` + - ``deletion_protection`` + - ``row_key_schema`` If ``column_families`` is set in ``update_mask``, it will return an UNIMPLEMENTED error. @@ -616,7 +616,7 @@ class ModifyColumnFamiliesRequest(proto.Message): Required. The unique name of the table whose families should be modified. Values are of the form ``projects/{project}/instances/{instance}/tables/{table}``. - modifications (MutableSequence[google.cloud.bigtable_admin_v2.types.ModifyColumnFamiliesRequest.Modification]): + modifications (MutableSequence[google.cloud.bigtable.admin.types.ModifyColumnFamiliesRequest.Modification]): Required. Modifications to be atomically applied to the specified table's families. Entries are applied in order, meaning that @@ -641,13 +641,13 @@ class Modification(proto.Message): Attributes: id (str): The ID of the column family to be modified. - create (google.cloud.bigtable_admin_v2.types.ColumnFamily): + create (google.cloud.bigtable.admin.types.ColumnFamily): Create a new column family with the specified schema, or fail if one already exists with the given ID. This field is a member of `oneof`_ ``mod``. - update (google.cloud.bigtable_admin_v2.types.ColumnFamily): + update (google.cloud.bigtable.admin.types.ColumnFamily): Update an existing column family to the specified schema, or fail if no column family exists with the given ID. @@ -758,14 +758,14 @@ class CheckConsistencyRequest(proto.Message): consistency_token (str): Required. The token created using GenerateConsistencyToken for the Table. - standard_read_remote_writes (google.cloud.bigtable_admin_v2.types.StandardReadRemoteWrites): + standard_read_remote_writes (google.cloud.bigtable.admin.types.StandardReadRemoteWrites): Checks that reads using an app profile with ``StandardIsolation`` can see all writes committed before the token was created, even if the read and write target different clusters. This field is a member of `oneof`_ ``mode``. - data_boost_read_local_writes (google.cloud.bigtable_admin_v2.types.DataBoostReadLocalWrites): + data_boost_read_local_writes (google.cloud.bigtable.admin.types.DataBoostReadLocalWrites): Checks that reads using an app profile with ``DataBoostIsolationReadOnly`` can see all writes committed before the token was created, but only if the read and write @@ -959,7 +959,7 @@ class ListSnapshotsResponse(proto.Message): any SLA or deprecation policy. Attributes: - snapshots (MutableSequence[google.cloud.bigtable_admin_v2.types.Snapshot]): + snapshots (MutableSequence[google.cloud.bigtable.admin.types.Snapshot]): The snapshots present in the requested cluster. next_page_token (str): @@ -1016,7 +1016,7 @@ class SnapshotTableMetadata(proto.Message): use. It is not subject to any SLA or deprecation policy. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.SnapshotTableRequest): + original_request (google.cloud.bigtable.admin.types.SnapshotTableRequest): The request that prompted the initiation of this SnapshotTable operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1054,7 +1054,7 @@ class CreateTableFromSnapshotMetadata(proto.Message): use. It is not subject to any SLA or deprecation policy. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.CreateTableFromSnapshotRequest): + original_request (google.cloud.bigtable.admin.types.CreateTableFromSnapshotRequest): The request that prompted the initiation of this CreateTableFromSnapshot operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1099,8 +1099,8 @@ class CreateBackupRequest(proto.Message): name, of the form: ``projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}``. This string must be between 1 and 50 characters in length - and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]*. - backup (google.cloud.bigtable_admin_v2.types.Backup): + and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]\*. + backup (google.cloud.bigtable.admin.types.Backup): Required. The backup to create. """ @@ -1161,13 +1161,13 @@ class UpdateBackupRequest(proto.Message): [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup]. Attributes: - backup (google.cloud.bigtable_admin_v2.types.Backup): + backup (google.cloud.bigtable.admin.types.Backup): Required. The backup to update. ``backup.name``, and the fields to be updated as specified by ``update_mask`` are required. Other fields are ignored. Update is only supported for the following fields: - - ``backup.expire_time``. + - ``backup.expire_time``. update_mask (google.protobuf.field_mask_pb2.FieldMask): Required. A mask specifying which fields (e.g. ``expire_time``) in the Backup resource should be updated. @@ -1246,16 +1246,16 @@ class ListBackupsRequest(proto.Message): The fields eligible for filtering are: - - ``name`` - - ``source_table`` - - ``state`` - - ``start_time`` (and values are of the format - YYYY-MM-DDTHH:MM:SSZ) - - ``end_time`` (and values are of the format - YYYY-MM-DDTHH:MM:SSZ) - - ``expire_time`` (and values are of the format - YYYY-MM-DDTHH:MM:SSZ) - - ``size_bytes`` + - ``name`` + - ``source_table`` + - ``state`` + - ``start_time`` (and values are of the format + YYYY-MM-DDTHH:MM:SSZ) + - ``end_time`` (and values are of the format + YYYY-MM-DDTHH:MM:SSZ) + - ``expire_time`` (and values are of the format + YYYY-MM-DDTHH:MM:SSZ) + - ``size_bytes`` To filter on multiple expressions, provide each separate expression within parentheses. By default, each expression @@ -1264,20 +1264,20 @@ class ListBackupsRequest(proto.Message): Some examples of using filters are: - - ``name:"exact"`` --> The backup's name is the string - "exact". - - ``name:howl`` --> The backup's name contains the string - "howl". - - ``source_table:prod`` --> The source_table's name - contains the string "prod". - - ``state:CREATING`` --> The backup is pending creation. - - ``state:READY`` --> The backup is fully created and ready - for use. - - ``(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`` - --> The backup name contains the string "howl" and - start_time of the backup is before 2018-03-28T14:50:00Z. - - ``size_bytes > 10000000000`` --> The backup's size is - greater than 10GB + - ``name:"exact"`` --> The backup's name is the string + "exact". + - ``name:howl`` --> The backup's name contains the string + "howl". + - ``source_table:prod`` --> The source_table's name contains + the string "prod". + - ``state:CREATING`` --> The backup is pending creation. + - ``state:READY`` --> The backup is fully created and ready + for use. + - ``(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`` + --> The backup name contains the string "howl" and + start_time of the backup is before 2018-03-28T14:50:00Z. + - ``size_bytes > 10000000000`` --> The backup's size is + greater than 10GB order_by (str): An expression for specifying the sort order of the results of the request. The string value should specify one or more @@ -1286,13 +1286,13 @@ class ListBackupsRequest(proto.Message): Fields supported are: - - name - - source_table - - expire_time - - start_time - - end_time - - size_bytes - - state + - name + - source_table + - expire_time + - start_time + - end_time + - size_bytes + - state For example, "start_time". The default sorting order is ascending. To specify descending order for the field, a @@ -1342,7 +1342,7 @@ class ListBackupsResponse(proto.Message): [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. Attributes: - backups (MutableSequence[google.cloud.bigtable_admin_v2.types.Backup]): + backups (MutableSequence[google.cloud.bigtable.admin.types.Backup]): The list of matching backups. next_page_token (str): ``next_page_token`` can be sent in a subsequent @@ -1381,7 +1381,7 @@ class CopyBackupRequest(proto.Message): to create the full backup name, of the form: ``projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}``. This string must be between 1 and 50 characters in length - and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]*. + and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]\*. source_backup (str): Required. The source backup to be copied from. The source backup needs to be in READY state for it to be copied. @@ -1426,10 +1426,10 @@ class CopyBackupMetadata(proto.Message): The name of the backup being created through the copy operation. Values are of the form ``projects//instances//clusters//backups/``. - source_backup_info (google.cloud.bigtable_admin_v2.types.BackupInfo): + source_backup_info (google.cloud.bigtable.admin.types.BackupInfo): Information about the source backup that is being copied from. - progress (google.cloud.bigtable_admin_v2.types.OperationProgress): + progress (google.cloud.bigtable.admin.types.OperationProgress): The progress of the [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup] operation. @@ -1466,7 +1466,7 @@ class CreateAuthorizedViewRequest(proto.Message): ``authorized_view_id`` appended to ``parent`` forms the full AuthorizedView name of the form ``projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}``. - authorized_view (google.cloud.bigtable_admin_v2.types.AuthorizedView): + authorized_view (google.cloud.bigtable.admin.types.AuthorizedView): Required. The AuthorizedView to create. """ @@ -1490,7 +1490,7 @@ class CreateAuthorizedViewMetadata(proto.Message): CreateAuthorizedView. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.CreateAuthorizedViewRequest): + original_request (google.cloud.bigtable.admin.types.CreateAuthorizedViewRequest): The request that prompted the initiation of this CreateAuthorizedView operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1542,7 +1542,7 @@ class ListAuthorizedViewsRequest(proto.Message): page_token (str): Optional. The value of ``next_page_token`` returned by a previous call. - view (google.cloud.bigtable_admin_v2.types.AuthorizedView.ResponseView): + view (google.cloud.bigtable.admin.types.AuthorizedView.ResponseView): Optional. The resource_view to be applied to the returned AuthorizedViews' fields. Default to NAME_ONLY. """ @@ -1571,7 +1571,7 @@ class ListAuthorizedViewsResponse(proto.Message): [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] Attributes: - authorized_views (MutableSequence[google.cloud.bigtable_admin_v2.types.AuthorizedView]): + authorized_views (MutableSequence[google.cloud.bigtable.admin.types.AuthorizedView]): The AuthorizedViews present in the requested table. next_page_token (str): @@ -1604,7 +1604,7 @@ class GetAuthorizedViewRequest(proto.Message): Required. The unique name of the requested AuthorizedView. Values are of the form ``projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}``. - view (google.cloud.bigtable_admin_v2.types.AuthorizedView.ResponseView): + view (google.cloud.bigtable.admin.types.AuthorizedView.ResponseView): Optional. The resource_view to be applied to the returned AuthorizedView's fields. Default to BASIC. """ @@ -1625,7 +1625,7 @@ class UpdateAuthorizedViewRequest(proto.Message): [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]. Attributes: - authorized_view (google.cloud.bigtable_admin_v2.types.AuthorizedView): + authorized_view (google.cloud.bigtable.admin.types.AuthorizedView): Required. The AuthorizedView to update. The ``name`` in ``authorized_view`` is used to identify the AuthorizedView. AuthorizedView name must in this format: @@ -1665,7 +1665,7 @@ class UpdateAuthorizedViewMetadata(proto.Message): [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.UpdateAuthorizedViewRequest): + original_request (google.cloud.bigtable.admin.types.UpdateAuthorizedViewRequest): The request that prompted the initiation of this UpdateAuthorizedView operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1733,7 +1733,7 @@ class CreateSchemaBundleRequest(proto.Message): Required. The unique ID to use for the schema bundle, which will become the final component of the schema bundle's resource name. - schema_bundle (google.cloud.bigtable_admin_v2.types.SchemaBundle): + schema_bundle (google.cloud.bigtable.admin.types.SchemaBundle): Required. The schema bundle to create. """ @@ -1789,7 +1789,7 @@ class UpdateSchemaBundleRequest(proto.Message): [UpdateSchemaBundle][google.bigtable.admin.v2.BigtableTableAdmin.UpdateSchemaBundle]. Attributes: - schema_bundle (google.cloud.bigtable_admin_v2.types.SchemaBundle): + schema_bundle (google.cloud.bigtable.admin.types.SchemaBundle): Required. The schema bundle to update. The schema bundle's ``name`` field is used to identify the @@ -1914,7 +1914,7 @@ class ListSchemaBundlesResponse(proto.Message): [ListSchemaBundles][google.bigtable.admin.v2.BigtableTableAdmin.ListSchemaBundles]. Attributes: - schema_bundles (MutableSequence[google.cloud.bigtable_admin_v2.types.SchemaBundle]): + schema_bundles (MutableSequence[google.cloud.bigtable.admin.types.SchemaBundle]): The schema bundles from the specified table. next_page_token (str): A token, which can be sent as ``page_token`` to retrieve the diff --git a/google/cloud/bigtable_admin_v2/types/common.py b/google/cloud/bigtable/admin/types/common.py similarity index 100% rename from google/cloud/bigtable_admin_v2/types/common.py rename to google/cloud/bigtable/admin/types/common.py diff --git a/google/cloud/bigtable_admin_v2/types/instance.py b/google/cloud/bigtable/admin/types/instance.py similarity index 92% rename from google/cloud/bigtable_admin_v2/types/instance.py rename to google/cloud/bigtable/admin/types/instance.py index 865487f0d..1dcac6406 100644 --- a/google/cloud/bigtable_admin_v2/types/instance.py +++ b/google/cloud/bigtable/admin/types/instance.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.cloud.bigtable_admin_v2.types import common +from google.cloud.bigtable.admin.types import common from google.protobuf import timestamp_pb2 # type: ignore @@ -56,10 +56,10 @@ class Instance(proto.Message): instance as it appears in UIs. Can be changed at any time, but should be kept globally unique to avoid confusion. - state (google.cloud.bigtable_admin_v2.types.Instance.State): + state (google.cloud.bigtable.admin.types.Instance.State): Output only. The current state of the instance. - type_ (google.cloud.bigtable_admin_v2.types.Instance.Type): + type_ (google.cloud.bigtable.admin.types.Instance.Type): The type of the instance. Defaults to ``PRODUCTION``. labels (MutableMapping[str, str]): Labels are a flexible and lightweight mechanism for @@ -67,15 +67,15 @@ class Instance(proto.Message): customer's organizational needs and deployment strategies. They can be used to filter resources and aggregate metrics. - - Label keys must be between 1 and 63 characters long and - must conform to the regular expression: - ``[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}``. - - Label values must be between 0 and 63 characters long and - must conform to the regular expression: - ``[\p{Ll}\p{Lo}\p{N}_-]{0,63}``. - - No more than 64 labels can be associated with a given - resource. - - Keys and values must both be under 128 bytes. + - Label keys must be between 1 and 63 characters long and + must conform to the regular expression: + ``[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}``. + - Label values must be between 0 and 63 characters long and + must conform to the regular expression: + ``[\p{Ll}\p{Lo}\p{N}_-]{0,63}``. + - No more than 64 labels can be associated with a given + resource. + - Keys and values must both be under 128 bytes. create_time (google.protobuf.timestamp_pb2.Timestamp): Output only. A commit timestamp representing when this Instance was created. For instances created before this @@ -261,7 +261,7 @@ class Cluster(proto.Message): located as close as possible to this cluster. Currently only zones are supported, so values should be of the form ``projects/{project}/locations/{zone}``. - state (google.cloud.bigtable_admin_v2.types.Cluster.State): + state (google.cloud.bigtable.admin.types.Cluster.State): Output only. The current state of the cluster. serve_nodes (int): @@ -269,18 +269,18 @@ class Cluster(proto.Message): value is set, Cloud Bigtable automatically allocates nodes based on your data footprint and optimized for 50% storage utilization. - node_scaling_factor (google.cloud.bigtable_admin_v2.types.Cluster.NodeScalingFactor): + node_scaling_factor (google.cloud.bigtable.admin.types.Cluster.NodeScalingFactor): Immutable. The node scaling factor of this cluster. - cluster_config (google.cloud.bigtable_admin_v2.types.Cluster.ClusterConfig): + cluster_config (google.cloud.bigtable.admin.types.Cluster.ClusterConfig): Configuration for this cluster. This field is a member of `oneof`_ ``config``. - default_storage_type (google.cloud.bigtable_admin_v2.types.StorageType): + default_storage_type (google.cloud.bigtable.admin.types.StorageType): Immutable. The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden. - encryption_config (google.cloud.bigtable_admin_v2.types.Cluster.EncryptionConfig): + encryption_config (google.cloud.bigtable.admin.types.Cluster.EncryptionConfig): Immutable. The encryption configuration for CMEK-protected clusters. """ @@ -345,10 +345,10 @@ class ClusterAutoscalingConfig(proto.Message): r"""Autoscaling config for a cluster. Attributes: - autoscaling_limits (google.cloud.bigtable_admin_v2.types.AutoscalingLimits): + autoscaling_limits (google.cloud.bigtable.admin.types.AutoscalingLimits): Required. Autoscaling limits for this cluster. - autoscaling_targets (google.cloud.bigtable_admin_v2.types.AutoscalingTargets): + autoscaling_targets (google.cloud.bigtable.admin.types.AutoscalingTargets): Required. Autoscaling targets for this cluster. """ @@ -368,7 +368,7 @@ class ClusterConfig(proto.Message): r"""Configuration for a cluster. Attributes: - cluster_autoscaling_config (google.cloud.bigtable_admin_v2.types.Cluster.ClusterAutoscalingConfig): + cluster_autoscaling_config (google.cloud.bigtable.admin.types.Cluster.ClusterAutoscalingConfig): Autoscaling configuration for this cluster. """ @@ -472,15 +472,15 @@ class AppProfile(proto.Message): description (str): Long form description of the use case for this AppProfile. - multi_cluster_routing_use_any (google.cloud.bigtable_admin_v2.types.AppProfile.MultiClusterRoutingUseAny): + multi_cluster_routing_use_any (google.cloud.bigtable.admin.types.AppProfile.MultiClusterRoutingUseAny): Use a multi-cluster routing policy. This field is a member of `oneof`_ ``routing_policy``. - single_cluster_routing (google.cloud.bigtable_admin_v2.types.AppProfile.SingleClusterRouting): + single_cluster_routing (google.cloud.bigtable.admin.types.AppProfile.SingleClusterRouting): Use a single-cluster routing policy. This field is a member of `oneof`_ ``routing_policy``. - priority (google.cloud.bigtable_admin_v2.types.AppProfile.Priority): + priority (google.cloud.bigtable.admin.types.AppProfile.Priority): This field has been deprecated in favor of ``standard_isolation.priority``. If you set this field, ``standard_isolation.priority`` will be set instead. @@ -488,12 +488,12 @@ class AppProfile(proto.Message): The priority of requests sent using this app profile. This field is a member of `oneof`_ ``isolation``. - standard_isolation (google.cloud.bigtable_admin_v2.types.AppProfile.StandardIsolation): + standard_isolation (google.cloud.bigtable.admin.types.AppProfile.StandardIsolation): The standard options used for isolating this app profile's traffic from other use cases. This field is a member of `oneof`_ ``isolation``. - data_boost_isolation_read_only (google.cloud.bigtable_admin_v2.types.AppProfile.DataBoostIsolationReadOnly): + data_boost_isolation_read_only (google.cloud.bigtable.admin.types.AppProfile.DataBoostIsolationReadOnly): Specifies that this app profile is intended for read-only usage via the Data Boost feature. @@ -538,7 +538,7 @@ class MultiClusterRoutingUseAny(proto.Message): ignored; clusters will be tried in order of distance. If left empty, all clusters are eligible. - row_affinity (google.cloud.bigtable_admin_v2.types.AppProfile.MultiClusterRoutingUseAny.RowAffinity): + row_affinity (google.cloud.bigtable.admin.types.AppProfile.MultiClusterRoutingUseAny.RowAffinity): Row affinity sticky routing based on the row key of the request. Requests that span multiple rows are routed non-deterministically. @@ -601,7 +601,7 @@ class StandardIsolation(proto.Message): from other use cases. Attributes: - priority (google.cloud.bigtable_admin_v2.types.AppProfile.Priority): + priority (google.cloud.bigtable.admin.types.AppProfile.Priority): The priority of requests sent using this app profile. """ @@ -623,7 +623,7 @@ class DataBoostIsolationReadOnly(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - compute_billing_owner (google.cloud.bigtable_admin_v2.types.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner): + compute_billing_owner (google.cloud.bigtable.admin.types.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner): The Compute Billing Owner for this Data Boost App Profile. diff --git a/google/cloud/bigtable_admin_v2/types/table.py b/google/cloud/bigtable/admin/types/table.py similarity index 89% rename from google/cloud/bigtable_admin_v2/types/table.py rename to google/cloud/bigtable/admin/types/table.py index c15eac799..2a1a58bbd 100644 --- a/google/cloud/bigtable_admin_v2/types/table.py +++ b/google/cloud/bigtable/admin/types/table.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.cloud.bigtable_admin_v2.types import types -from google.cloud.bigtable_admin_v2.utils import oneof_message +from google.cloud.bigtable.admin.types import types +from google.cloud.bigtable.admin.utils import oneof_message from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore @@ -66,9 +66,9 @@ class RestoreInfo(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - source_type (google.cloud.bigtable_admin_v2.types.RestoreSourceType): + source_type (google.cloud.bigtable.admin.types.RestoreSourceType): The type of the restore source. - backup_info (google.cloud.bigtable_admin_v2.types.BackupInfo): + backup_info (google.cloud.bigtable.admin.types.BackupInfo): Information about the backup used to restore the table. The backup may no longer exist. @@ -123,29 +123,29 @@ class Table(proto.Message): ``projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*``. Views: ``NAME_ONLY``, ``SCHEMA_VIEW``, ``REPLICATION_VIEW``, ``FULL`` - cluster_states (MutableMapping[str, google.cloud.bigtable_admin_v2.types.Table.ClusterState]): + cluster_states (MutableMapping[str, google.cloud.bigtable.admin.types.Table.ClusterState]): Output only. Map from cluster ID to per-cluster table state. If it could not be determined whether or not the table has data in a particular cluster (for example, if its zone is unavailable), then there will be an entry for the cluster with UNKNOWN ``replication_status``. Views: ``REPLICATION_VIEW``, ``ENCRYPTION_VIEW``, ``FULL`` - column_families (MutableMapping[str, google.cloud.bigtable_admin_v2.types.ColumnFamily]): + column_families (MutableMapping[str, google.cloud.bigtable.admin.types.ColumnFamily]): The column families configured for this table, mapped by column family ID. Views: ``SCHEMA_VIEW``, ``STATS_VIEW``, ``FULL`` - granularity (google.cloud.bigtable_admin_v2.types.Table.TimestampGranularity): + granularity (google.cloud.bigtable.admin.types.Table.TimestampGranularity): Immutable. The granularity (i.e. ``MILLIS``) at which timestamps are stored in this table. Timestamps not matching the granularity will be rejected. If unspecified at creation time, the value will be set to ``MILLIS``. Views: ``SCHEMA_VIEW``, ``FULL``. - restore_info (google.cloud.bigtable_admin_v2.types.RestoreInfo): + restore_info (google.cloud.bigtable.admin.types.RestoreInfo): Output only. If this table was restored from another data source (e.g. a backup), this field will be populated with information about the restore. - change_stream_config (google.cloud.bigtable_admin_v2.types.ChangeStreamConfig): + change_stream_config (google.cloud.bigtable.admin.types.ChangeStreamConfig): If specified, enable the change stream on this table. Otherwise, the change stream is disabled and the change stream is not retained. @@ -154,19 +154,19 @@ class Table(proto.Message): i.e. deleting the following resources through Admin APIs are prohibited: - - The table. - - The column families in the table. - - The instance containing the table. + - The table. + - The column families in the table. + - The instance containing the table. Note one can still delete the data stored in the table through Data APIs. - automated_backup_policy (google.cloud.bigtable_admin_v2.types.Table.AutomatedBackupPolicy): + automated_backup_policy (google.cloud.bigtable.admin.types.Table.AutomatedBackupPolicy): If specified, automated backups are enabled for this table. Otherwise, automated backups are disabled. This field is a member of `oneof`_ ``automated_backup_config``. - row_key_schema (google.cloud.bigtable_admin_v2.types.Type.Struct): + row_key_schema (google.cloud.bigtable.admin.types.Type.Struct): The row key schema for this table. The schema is used to decode the raw row key bytes into a structured format. The order of field declarations in this schema is important, as @@ -181,37 +181,22 @@ class Table(proto.Message): they encounter an invalid row key. For example, if \_key = - "some_id#2024-04-30#\x00\x13\x00\xf3" with the following - schema: - - .. code-block:: - - { - fields { - field_name: "id" - type { string { encoding: utf8_bytes {} } } - } - fields { - field_name: "date" - type { string { encoding: utf8_bytes {} } } - } - fields { - field_name: "product_code" - type { int64 { encoding: big_endian_bytes {} } } - } - encoding { delimited_bytes { delimiter: "#" } } - } - - The decoded key parts would be: - id = "some_id", date = "2024-04-30", product_code = 1245427 - The query "SELECT \_key, product_code FROM table" will return - two columns: - - +========================================+==============+ - | \_key | product_code | - +========================================+==============+ - | "some_id#2024-04-30#\x00\x13\x00\xf3" | 1245427 | - +----------------------------------------+--------------+ + "some_id#2024-04-30#\\x00\\x13\\x00\\xf3" with the following + schema: { fields { field_name: "id" type { string { + encoding: utf8_bytes {} } } } fields { field_name: "date" + type { string { encoding: utf8_bytes {} } } } fields { + field_name: "product_code" type { int64 { encoding: + big_endian_bytes {} } } } encoding { delimited_bytes { + delimiter: "#" } } } + + | The decoded key parts would be: id = "some_id", date = + "2024-04-30", product_code = 1245427 The query "SELECT + \_key, product_code FROM table" will return two columns: + /------------------------------------------------------ + | \| \_key \| product_code \| \| + --------------------------------------\|--------------\| + \| "some_id#2024-04-30#\\x00\\x13\\x00\\xf3" \| 1245427 \| + ------------------------------------------------------/ The schema has the following invariants: (1) The decoded field values are order-preserved. For read, the field values @@ -221,19 +206,19 @@ class Table(proto.Message): type is limited to scalar types only: Array, Map, Aggregate, and Struct are not allowed. (4) The field names must not collide with existing column family names and reserved - keywords "_key" and "_timestamp". + keywords "\_key" and "\_timestamp". The following update operations are allowed for row_key_schema: - - Update from an empty schema to a new schema. - - Remove the existing schema. This operation requires - setting the ``ignore_warnings`` flag to ``true``, since - it might be a backward incompatible change. Without the - flag, the update request will fail with an - INVALID_ARGUMENT error. Any other row key schema update - operation (e.g. update existing schema columns names or - types) is currently unsupported. + - Update from an empty schema to a new schema. + - Remove the existing schema. This operation requires + setting the ``ignore_warnings`` flag to ``true``, since it + might be a backward incompatible change. Without the flag, + the update request will fail with an INVALID_ARGUMENT + error. Any other row key schema update operation (e.g. + update existing schema columns names or types) is + currently unsupported. """ class TimestampGranularity(proto.Enum): @@ -284,10 +269,10 @@ class ClusterState(proto.Message): r"""The state of a table's data in a particular cluster. Attributes: - replication_state (google.cloud.bigtable_admin_v2.types.Table.ClusterState.ReplicationState): + replication_state (google.cloud.bigtable.admin.types.Table.ClusterState.ReplicationState): Output only. The state of replication for the table in this cluster. - encryption_info (MutableSequence[google.cloud.bigtable_admin_v2.types.EncryptionInfo]): + encryption_info (MutableSequence[google.cloud.bigtable.admin.types.EncryptionInfo]): Output only. The encryption information for the table in this cluster. If the encryption key protecting this resource is customer managed, @@ -435,7 +420,7 @@ class AuthorizedView(proto.Message): Identifier. The name of this AuthorizedView. Values are of the form ``projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`` - subset_view (google.cloud.bigtable_admin_v2.types.AuthorizedView.SubsetView): + subset_view (google.cloud.bigtable.admin.types.AuthorizedView.SubsetView): An AuthorizedView permitting access to an explicit subset of a Table. @@ -507,7 +492,7 @@ class SubsetView(proto.Message): Row prefixes to be included in the AuthorizedView. To provide access to all rows, include the empty string as a prefix (""). - family_subsets (MutableMapping[str, google.cloud.bigtable_admin_v2.types.AuthorizedView.FamilySubsets]): + family_subsets (MutableMapping[str, google.cloud.bigtable.admin.types.AuthorizedView.FamilySubsets]): Map from column family name to the columns in this family to be included in the AuthorizedView. @@ -551,7 +536,7 @@ class ColumnFamily(proto.Message): configuration. Attributes: - gc_rule (google.cloud.bigtable_admin_v2.types.GcRule): + gc_rule (google.cloud.bigtable.admin.types.GcRule): Garbage collection rule specified as a protobuf. Must serialize to at most 500 bytes. @@ -559,7 +544,7 @@ class ColumnFamily(proto.Message): opportunistically in the background, and so it's possible for reads to return a cell even if it matches the active GC expression for its family. - value_type (google.cloud.bigtable_admin_v2.types.Type): + value_type (google.cloud.bigtable.admin.types.Type): The type of data stored in each of this family's cell values, including its full encoding. If omitted, the family only serves raw untyped bytes. @@ -572,7 +557,7 @@ class ColumnFamily(proto.Message): If ``value_type`` is ``Aggregate``, written data must be compatible with: - - ``value_type.input_type`` for ``AddInput`` mutations + - ``value_type.input_type`` for ``AddInput`` mutations """ gc_rule: "GcRule" = proto.Field( @@ -611,12 +596,12 @@ class GcRule(oneof_message.OneofMessage): granularity. This field is a member of `oneof`_ ``rule``. - intersection (google.cloud.bigtable_admin_v2.types.GcRule.Intersection): + intersection (google.cloud.bigtable.admin.types.GcRule.Intersection): Delete cells that would be deleted by every nested rule. This field is a member of `oneof`_ ``rule``. - union (google.cloud.bigtable_admin_v2.types.GcRule.Union): + union (google.cloud.bigtable.admin.types.GcRule.Union): Delete cells that would be deleted by any nested rule. @@ -627,7 +612,7 @@ class Intersection(proto.Message): r"""A GcRule which deletes cells matching all of the given rules. Attributes: - rules (MutableSequence[google.cloud.bigtable_admin_v2.types.GcRule]): + rules (MutableSequence[google.cloud.bigtable.admin.types.GcRule]): Only delete cells which would be deleted by every element of ``rules``. """ @@ -642,7 +627,7 @@ class Union(proto.Message): r"""A GcRule which deletes cells matching any of the given rules. Attributes: - rules (MutableSequence[google.cloud.bigtable_admin_v2.types.GcRule]): + rules (MutableSequence[google.cloud.bigtable.admin.types.GcRule]): Delete cells which would be deleted by any element of ``rules``. """ @@ -685,7 +670,7 @@ class EncryptionInfo(proto.Message): is specified along with its status. Attributes: - encryption_type (google.cloud.bigtable_admin_v2.types.EncryptionInfo.EncryptionType): + encryption_type (google.cloud.bigtable.admin.types.EncryptionInfo.EncryptionType): Output only. The type of encryption used to protect this resource. encryption_status (google.rpc.status_pb2.Status): @@ -755,7 +740,7 @@ class Snapshot(proto.Message): name (str): The unique name of the snapshot. Values are of the form ``projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}``. - source_table (google.cloud.bigtable_admin_v2.types.Table): + source_table (google.cloud.bigtable.admin.types.Table): Output only. The source table at the time the snapshot was taken. data_size_bytes (int): @@ -772,7 +757,7 @@ class Snapshot(proto.Message): The maximum amount of time a snapshot can stay active is 365 days. If 'ttl' is not specified, the default maximum of 365 days will be used. - state (google.cloud.bigtable_admin_v2.types.Snapshot.State): + state (google.cloud.bigtable.admin.types.Snapshot.State): Output only. The current state of the snapshot. description (str): @@ -864,8 +849,8 @@ class Backup(proto.Message): backup or updating its ``expire_time``, the value must be greater than the backup creation time by: - - At least 6 hours - - At most 90 days + - At least 6 hours + - At most 90 days Once the ``expire_time`` has passed, Cloud Bigtable will delete the backup. @@ -881,12 +866,12 @@ class Backup(proto.Message): this timestamp. size_bytes (int): Output only. Size of the backup in bytes. - state (google.cloud.bigtable_admin_v2.types.Backup.State): + state (google.cloud.bigtable.admin.types.Backup.State): Output only. The current state of the backup. - encryption_info (google.cloud.bigtable_admin_v2.types.EncryptionInfo): + encryption_info (google.cloud.bigtable.admin.types.EncryptionInfo): Output only. The encryption information for the backup. - backup_type (google.cloud.bigtable_admin_v2.types.Backup.BackupType): + backup_type (google.cloud.bigtable.admin.types.Backup.BackupType): Indicates the backup type of the backup. hot_to_standard_time (google.protobuf.timestamp_pb2.Timestamp): The time at which the hot backup will be converted to a @@ -895,7 +880,7 @@ class Backup(proto.Message): standard backup. This value must be greater than the backup creation time by: - - At least 24 hours + - At least 24 hours This field only applies for hot backups. When creating or updating a standard backup, attempting to set this field @@ -1083,7 +1068,7 @@ class SchemaBundle(proto.Message): Identifier. The unique name identifying this schema bundle. Values are of the form ``projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`` - proto_schema (google.cloud.bigtable_admin_v2.types.ProtoSchema): + proto_schema (google.cloud.bigtable.admin.types.ProtoSchema): Schema for Protobufs. This field is a member of `oneof`_ ``type``. diff --git a/google/cloud/bigtable_admin_v2/types/types.py b/google/cloud/bigtable/admin/types/types.py similarity index 79% rename from google/cloud/bigtable_admin_v2/types/types.py rename to google/cloud/bigtable/admin/types/types.py index b6ea5341d..3cc267409 100644 --- a/google/cloud/bigtable_admin_v2/types/types.py +++ b/google/cloud/bigtable/admin/types/types.py @@ -40,15 +40,15 @@ class Type(proto.Message): Each encoding can operate in one of two modes: - - Sorted: In this mode, Bigtable guarantees that - ``Encode(X) <= Encode(Y)`` if and only if ``X <= Y``. This is - useful anywhere sort order is important, for example when - encoding keys. - - Distinct: In this mode, Bigtable guarantees that if ``X != Y`` - then ``Encode(X) != Encode(Y)``. However, the converse is not - guaranteed. For example, both "{'foo': '1', 'bar': '2'}" and - "{'bar': '2', 'foo': '1'}" are valid encodings of the same JSON - value. + - Sorted: In this mode, Bigtable guarantees that + ``Encode(X) <= Encode(Y)`` if and only if ``X <= Y``. This is + useful anywhere sort order is important, for example when encoding + keys. + - Distinct: In this mode, Bigtable guarantees that if ``X != Y`` + then ``Encode(X) != Encode(Y)``. However, the converse is not + guaranteed. For example, both "{'foo': '1', 'bar': '2'}" and + "{'bar': '2', 'foo': '1'}" are valid encodings of the same JSON + value. The API clearly documents which mode is used wherever an encoding can be configured. Each encoding also documents which values are @@ -65,59 +65,59 @@ class Type(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - bytes_type (google.cloud.bigtable_admin_v2.types.Type.Bytes): + bytes_type (google.cloud.bigtable.admin.types.Type.Bytes): Bytes This field is a member of `oneof`_ ``kind``. - string_type (google.cloud.bigtable_admin_v2.types.Type.String): + string_type (google.cloud.bigtable.admin.types.Type.String): String This field is a member of `oneof`_ ``kind``. - int64_type (google.cloud.bigtable_admin_v2.types.Type.Int64): + int64_type (google.cloud.bigtable.admin.types.Type.Int64): Int64 This field is a member of `oneof`_ ``kind``. - float32_type (google.cloud.bigtable_admin_v2.types.Type.Float32): + float32_type (google.cloud.bigtable.admin.types.Type.Float32): Float32 This field is a member of `oneof`_ ``kind``. - float64_type (google.cloud.bigtable_admin_v2.types.Type.Float64): + float64_type (google.cloud.bigtable.admin.types.Type.Float64): Float64 This field is a member of `oneof`_ ``kind``. - bool_type (google.cloud.bigtable_admin_v2.types.Type.Bool): + bool_type (google.cloud.bigtable.admin.types.Type.Bool): Bool This field is a member of `oneof`_ ``kind``. - timestamp_type (google.cloud.bigtable_admin_v2.types.Type.Timestamp): + timestamp_type (google.cloud.bigtable.admin.types.Type.Timestamp): Timestamp This field is a member of `oneof`_ ``kind``. - date_type (google.cloud.bigtable_admin_v2.types.Type.Date): + date_type (google.cloud.bigtable.admin.types.Type.Date): Date This field is a member of `oneof`_ ``kind``. - aggregate_type (google.cloud.bigtable_admin_v2.types.Type.Aggregate): + aggregate_type (google.cloud.bigtable.admin.types.Type.Aggregate): Aggregate This field is a member of `oneof`_ ``kind``. - struct_type (google.cloud.bigtable_admin_v2.types.Type.Struct): + struct_type (google.cloud.bigtable.admin.types.Type.Struct): Struct This field is a member of `oneof`_ ``kind``. - array_type (google.cloud.bigtable_admin_v2.types.Type.Array): + array_type (google.cloud.bigtable.admin.types.Type.Array): Array This field is a member of `oneof`_ ``kind``. - map_type (google.cloud.bigtable_admin_v2.types.Type.Map): + map_type (google.cloud.bigtable.admin.types.Type.Map): Map This field is a member of `oneof`_ ``kind``. - proto_type (google.cloud.bigtable_admin_v2.types.Type.Proto): + proto_type (google.cloud.bigtable.admin.types.Type.Proto): Proto This field is a member of `oneof`_ ``kind``. - enum_type (google.cloud.bigtable_admin_v2.types.Type.Enum): + enum_type (google.cloud.bigtable.admin.types.Type.Enum): Enum This field is a member of `oneof`_ ``kind``. @@ -127,7 +127,7 @@ class Bytes(proto.Message): r"""Bytes Values of type ``Bytes`` are stored in ``Value.bytes_value``. Attributes: - encoding (google.cloud.bigtable_admin_v2.types.Type.Bytes.Encoding): + encoding (google.cloud.bigtable.admin.types.Type.Bytes.Encoding): The encoding to use when converting to or from lower level types. """ @@ -138,7 +138,7 @@ class Encoding(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - raw (google.cloud.bigtable_admin_v2.types.Type.Bytes.Encoding.Raw): + raw (google.cloud.bigtable.admin.types.Type.Bytes.Encoding.Raw): Use ``Raw`` encoding. This field is a member of `oneof`_ ``encoding``. @@ -171,7 +171,7 @@ class String(proto.Message): ``Value.string_value``. Attributes: - encoding (google.cloud.bigtable_admin_v2.types.Type.String.Encoding): + encoding (google.cloud.bigtable.admin.types.Type.String.Encoding): The encoding to use when converting to or from lower level types. """ @@ -187,11 +187,11 @@ class Encoding(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - utf8_raw (google.cloud.bigtable_admin_v2.types.Type.String.Encoding.Utf8Raw): + utf8_raw (google.cloud.bigtable.admin.types.Type.String.Encoding.Utf8Raw): Deprecated: if set, converts to an empty ``utf8_bytes``. This field is a member of `oneof`_ ``encoding``. - utf8_bytes (google.cloud.bigtable_admin_v2.types.Type.String.Encoding.Utf8Bytes): + utf8_bytes (google.cloud.bigtable.admin.types.Type.String.Encoding.Utf8Bytes): Use ``Utf8Bytes`` encoding. This field is a member of `oneof`_ ``encoding``. @@ -205,16 +205,16 @@ class Utf8Bytes(proto.Message): Sorted mode: - - All values are supported. - - Code point order is preserved. + - All values are supported. + - Code point order is preserved. Distinct mode: all values are supported. Compatible with: - - BigQuery ``TEXT`` encoding - - HBase ``Bytes.toBytes`` - - Java ``String#getBytes(StandardCharsets.UTF_8)`` + - BigQuery ``TEXT`` encoding + - HBase ``Bytes.toBytes`` + - Java ``String#getBytes(StandardCharsets.UTF_8)`` """ @@ -241,7 +241,7 @@ class Int64(proto.Message): r"""Int64 Values of type ``Int64`` are stored in ``Value.int_value``. Attributes: - encoding (google.cloud.bigtable_admin_v2.types.Type.Int64.Encoding): + encoding (google.cloud.bigtable.admin.types.Type.Int64.Encoding): The encoding to use when converting to or from lower level types. """ @@ -257,11 +257,11 @@ class Encoding(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - big_endian_bytes (google.cloud.bigtable_admin_v2.types.Type.Int64.Encoding.BigEndianBytes): + big_endian_bytes (google.cloud.bigtable.admin.types.Type.Int64.Encoding.BigEndianBytes): Use ``BigEndianBytes`` encoding. This field is a member of `oneof`_ ``encoding``. - ordered_code_bytes (google.cloud.bigtable_admin_v2.types.Type.Int64.Encoding.OrderedCodeBytes): + ordered_code_bytes (google.cloud.bigtable.admin.types.Type.Int64.Encoding.OrderedCodeBytes): Use ``OrderedCodeBytes`` encoding. This field is a member of `oneof`_ ``encoding``. @@ -276,12 +276,12 @@ class BigEndianBytes(proto.Message): Compatible with: - - BigQuery ``BINARY`` encoding - - HBase ``Bytes.toBytes`` - - Java ``ByteBuffer.putLong()`` with ``ByteOrder.BIG_ENDIAN`` + - BigQuery ``BINARY`` encoding + - HBase ``Bytes.toBytes`` + - Java ``ByteBuffer.putLong()`` with ``ByteOrder.BIG_ENDIAN`` Attributes: - bytes_type (google.cloud.bigtable_admin_v2.types.Type.Bytes): + bytes_type (google.cloud.bigtable.admin.types.Type.Bytes): Deprecated: ignored if set. """ @@ -340,7 +340,7 @@ class Timestamp(proto.Message): ``Value.timestamp_value``. Attributes: - encoding (google.cloud.bigtable_admin_v2.types.Type.Timestamp.Encoding): + encoding (google.cloud.bigtable.admin.types.Type.Timestamp.Encoding): The encoding to use when converting to or from lower level types. """ @@ -351,14 +351,14 @@ class Encoding(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - unix_micros_int64 (google.cloud.bigtable_admin_v2.types.Type.Int64.Encoding): + unix_micros_int64 (google.cloud.bigtable.admin.types.Type.Int64.Encoding): Encodes the number of microseconds since the Unix epoch using the given ``Int64`` encoding. Values must be microsecond-aligned. Compatible with: - - Java ``Instant.truncatedTo()`` with ``ChronoUnit.MICROS`` + - Java ``Instant.truncatedTo()`` with ``ChronoUnit.MICROS`` This field is a member of `oneof`_ ``encoding``. """ @@ -386,10 +386,10 @@ class Struct(proto.Message): as ``field_types``. Attributes: - fields (MutableSequence[google.cloud.bigtable_admin_v2.types.Type.Struct.Field]): + fields (MutableSequence[google.cloud.bigtable.admin.types.Type.Struct.Field]): The names and types of the fields in this struct. - encoding (google.cloud.bigtable_admin_v2.types.Type.Struct.Encoding): + encoding (google.cloud.bigtable.admin.types.Type.Struct.Encoding): The encoding to use when converting to or from lower level types. """ @@ -401,7 +401,7 @@ class Field(proto.Message): field_name (str): The field name (optional). Fields without a ``field_name`` are considered anonymous and cannot be referenced by name. - type_ (google.cloud.bigtable_admin_v2.types.Type): + type_ (google.cloud.bigtable.admin.types.Type): The type of values in this field. """ @@ -426,15 +426,15 @@ class Encoding(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - singleton (google.cloud.bigtable_admin_v2.types.Type.Struct.Encoding.Singleton): + singleton (google.cloud.bigtable.admin.types.Type.Struct.Encoding.Singleton): Use ``Singleton`` encoding. This field is a member of `oneof`_ ``encoding``. - delimited_bytes (google.cloud.bigtable_admin_v2.types.Type.Struct.Encoding.DelimitedBytes): + delimited_bytes (google.cloud.bigtable.admin.types.Type.Struct.Encoding.DelimitedBytes): Use ``DelimitedBytes`` encoding. This field is a member of `oneof`_ ``encoding``. - ordered_code_bytes (google.cloud.bigtable_admin_v2.types.Type.Struct.Encoding.OrderedCodeBytes): + ordered_code_bytes (google.cloud.bigtable.admin.types.Type.Struct.Encoding.OrderedCodeBytes): User ``OrderedCodeBytes`` encoding. This field is a member of `oneof`_ ``encoding``. @@ -455,17 +455,17 @@ class DelimitedBytes(proto.Message): Sorted mode: - - Fields are encoded in sorted mode. - - Encoded field values must not contain any bytes <= - ``delimiter[0]`` - - Element-wise order is preserved: ``A < B`` if ``A[0] < B[0]``, or - if ``A[0] == B[0] && A[1] < B[1]``, etc. Strict prefixes sort - first. + - Fields are encoded in sorted mode. + - Encoded field values must not contain any bytes <= + ``delimiter[0]`` + - Element-wise order is preserved: ``A < B`` if ``A[0] < B[0]``, or + if ``A[0] == B[0] && A[1] < B[1]``, etc. Strict prefixes sort + first. Distinct mode: - - Fields are encoded in distinct mode. - - Encoded field values must not contain ``delimiter[0]``. + - Fields are encoded in distinct mode. + - Encoded field values must not contain ``delimiter[0]``. Attributes: delimiter (bytes): @@ -488,24 +488,23 @@ class OrderedCodeBytes(proto.Message): Fields that encode to the empty string "" have special handling: - - If *every* field encodes to "", or if the STRUCT has no fields - defined, then the STRUCT is encoded as the fixed byte pair {0x00, - 0x00}. - - Otherwise, the STRUCT only encodes until the last non-empty - field, omitting any trailing empty fields. Any empty fields that - aren't omitted are replaced with the fixed byte pair {0x00, - 0x00}. + - If *every* field encodes to "", or if the STRUCT has no fields + defined, then the STRUCT is encoded as the fixed byte pair {0x00, + 0x00}. + - Otherwise, the STRUCT only encodes until the last non-empty field, + omitting any trailing empty fields. Any empty fields that aren't + omitted are replaced with the fixed byte pair {0x00, 0x00}. Examples: - - STRUCT() -> "\00\00" - - STRUCT("") -> "\00\00" - - STRUCT("", "") -> "\00\00" - - STRUCT("", "B") -> "\00\00" + "\00\01" + "B" - - STRUCT("A", "") -> "A" - - STRUCT("", "B", "") -> "\00\00" + "\00\01" + "B" - - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + - "C" + - STRUCT() -> "\\00\\00" + - STRUCT("") -> "\\00\\00" + - STRUCT("", "") -> "\\00\\00" + - STRUCT("", "B") -> "\\00\\00" + "\\00\\01" + "B" + - STRUCT("A", "") -> "A" + - STRUCT("", "B", "") -> "\\00\\00" + "\\00\\01" + "B" + - STRUCT("A", "", "C") -> "A" + "\\00\\01" + "\\00\\00" + "\\00\\01" + + "C" Since null bytes are always escaped, this encoding can cause size blowup for encodings like ``Int64.BigEndianBytes`` that are likely @@ -513,16 +512,16 @@ class OrderedCodeBytes(proto.Message): Sorted mode: - - Fields are encoded in sorted mode. - - All values supported by the field encodings are allowed - - Element-wise order is preserved: ``A < B`` if ``A[0] < B[0]``, or - if ``A[0] == B[0] && A[1] < B[1]``, etc. Strict prefixes sort - first. + - Fields are encoded in sorted mode. + - All values supported by the field encodings are allowed + - Element-wise order is preserved: ``A < B`` if ``A[0] < B[0]``, or + if ``A[0] == B[0] && A[1] < B[1]``, etc. Strict prefixes sort + first. Distinct mode: - - Fields are encoded in distinct mode. - - All values supported by the field encodings are allowed. + - Fields are encoded in distinct mode. + - All values supported by the field encodings are allowed. """ @@ -607,7 +606,7 @@ class Array(proto.Message): ``Array`` are stored in ``Value.array_value``. Attributes: - element_type (google.cloud.bigtable_admin_v2.types.Type): + element_type (google.cloud.bigtable.admin.types.Type): The type of the elements in the array. This must not be ``Array``. """ @@ -628,10 +627,10 @@ class Map(proto.Message): precedence. Attributes: - key_type (google.cloud.bigtable_admin_v2.types.Type): + key_type (google.cloud.bigtable.admin.types.Type): The type of a map key. Only ``Bytes``, ``String``, and ``Int64`` are allowed as key types. - value_type (google.cloud.bigtable_admin_v2.types.Type): + value_type (google.cloud.bigtable.admin.types.Type): The type of the values in a map. """ @@ -661,28 +660,28 @@ class Aggregate(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - input_type (google.cloud.bigtable_admin_v2.types.Type): + input_type (google.cloud.bigtable.admin.types.Type): Type of the inputs that are accumulated by this ``Aggregate``, which must specify a full encoding. Use ``AddInput`` mutations to accumulate new inputs. - state_type (google.cloud.bigtable_admin_v2.types.Type): + state_type (google.cloud.bigtable.admin.types.Type): Output only. Type that holds the internal accumulator state for the ``Aggregate``. This is a function of the ``input_type`` and ``aggregator`` chosen, and will always specify a full encoding. - sum (google.cloud.bigtable_admin_v2.types.Type.Aggregate.Sum): + sum (google.cloud.bigtable.admin.types.Type.Aggregate.Sum): Sum aggregator. This field is a member of `oneof`_ ``aggregator``. - hllpp_unique_count (google.cloud.bigtable_admin_v2.types.Type.Aggregate.HyperLogLogPlusPlusUniqueCount): + hllpp_unique_count (google.cloud.bigtable.admin.types.Type.Aggregate.HyperLogLogPlusPlusUniqueCount): HyperLogLogPlusPlusUniqueCount aggregator. This field is a member of `oneof`_ ``aggregator``. - max_ (google.cloud.bigtable_admin_v2.types.Type.Aggregate.Max): + max_ (google.cloud.bigtable.admin.types.Type.Aggregate.Max): Max aggregator. This field is a member of `oneof`_ ``aggregator``. - min_ (google.cloud.bigtable_admin_v2.types.Type.Aggregate.Min): + min_ (google.cloud.bigtable.admin.types.Type.Aggregate.Min): Min aggregator. This field is a member of `oneof`_ ``aggregator``. diff --git a/google/cloud/bigtable_admin_v2/utils/__init__.py b/google/cloud/bigtable/admin/utils/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/utils/__init__.py rename to google/cloud/bigtable/admin/utils/__init__.py diff --git a/google/cloud/bigtable_admin_v2/utils/oneof_message.py b/google/cloud/bigtable/admin/utils/oneof_message.py similarity index 100% rename from google/cloud/bigtable_admin_v2/utils/oneof_message.py rename to google/cloud/bigtable/admin/utils/oneof_message.py diff --git a/google/cloud/bigtable/app_profile.py b/google/cloud/bigtable/app_profile.py index 8cde66146..36c500a89 100644 --- a/google/cloud/bigtable/app_profile.py +++ b/google/cloud/bigtable/app_profile.py @@ -18,7 +18,7 @@ import re from google.cloud.bigtable.enums import RoutingPolicyType -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin.types import instance from google.protobuf import field_mask_pb2 from google.api_core.exceptions import NotFound diff --git a/google/cloud/bigtable/backup.py b/google/cloud/bigtable/backup.py index f6fa24421..9a57bc505 100644 --- a/google/cloud/bigtable/backup.py +++ b/google/cloud/bigtable/backup.py @@ -17,8 +17,8 @@ import re from google.cloud._helpers import _datetime_to_pb_timestamp # type: ignore -from google.cloud.bigtable_admin_v2 import BaseBigtableTableAdminClient -from google.cloud.bigtable_admin_v2.types import table +from google.cloud.bigtable.admin import BigtableTableAdminClient +from google.cloud.bigtable.admin.types import table from google.cloud.bigtable.encryption_info import EncryptionInfo from google.cloud.bigtable.policy import Policy from google.cloud.exceptions import NotFound # type: ignore @@ -106,7 +106,7 @@ def name(self): if not self._cluster: raise ValueError('"cluster" parameter must be set') - return BaseBigtableTableAdminClient.backup_path( + return BigtableTableAdminClient.backup_path( project=self._instance._client.project, instance=self._instance.instance_id, cluster=self._cluster, @@ -141,7 +141,7 @@ def parent(self): :returns: A full path to the parent cluster. """ if not self._parent and self._cluster: - self._parent = BaseBigtableTableAdminClient.cluster_path( + self._parent = BigtableTableAdminClient.cluster_path( project=self._instance._client.project, instance=self._instance.instance_id, cluster=self._cluster, @@ -163,7 +163,7 @@ def source_table(self): :returns: The Table name. """ if not self._source_table and self.table_id: - self._source_table = BaseBigtableTableAdminClient.table_path( + self._source_table = BigtableTableAdminClient.table_path( project=self._instance._client.project, instance=self._instance.instance_id, table=self.table_id, @@ -425,7 +425,7 @@ def restore(self, table_id, instance_id=None): """ api = self._instance._client.table_admin_client if instance_id: - parent = BaseBigtableTableAdminClient.instance_path( + parent = BigtableTableAdminClient.instance_path( project=self._instance._client.project, instance=instance_id, ) diff --git a/google/cloud/bigtable/client.py b/google/cloud/bigtable/client.py index 37de10b6e..d5ba3169c 100644 --- a/google/cloud/bigtable/client.py +++ b/google/cloud/bigtable/client.py @@ -35,12 +35,12 @@ from google.auth.credentials import AnonymousCredentials # type: ignore from google.cloud import bigtable_v2 -from google.cloud import bigtable_admin_v2 +from google.cloud.bigtable import admin from google.cloud.bigtable_v2.services.bigtable.transports import BigtableGrpcTransport -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.transports import ( +from google.cloud.bigtable.admin.services.bigtable_instance_admin.transports import ( BigtableInstanceAdminGrpcTransport, ) -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports import ( +from google.cloud.bigtable.admin.services.bigtable_table_admin.transports import ( BigtableTableAdminGrpcTransport, ) @@ -50,7 +50,7 @@ from google.cloud.client import ClientWithProject # type: ignore -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin.types import instance from google.cloud.bigtable.cluster import _CLUSTER_NAME_RE from google.cloud.environment_vars import BIGTABLE_EMULATOR # type: ignore @@ -325,11 +325,11 @@ def table_admin_client(self): raise ValueError("Client is not an admin client.") transport = self._create_gapic_client_channel( - bigtable_admin_v2.BaseBigtableTableAdminClient, + admin.BigtableTableAdminClient, BigtableTableAdminGrpcTransport, ) klass = _create_gapic_client( - bigtable_admin_v2.BaseBigtableTableAdminClient, + admin.BigtableTableAdminClient, client_options=self._admin_client_options, transport=transport, ) @@ -358,11 +358,11 @@ def instance_admin_client(self): raise ValueError("Client is not an admin client.") transport = self._create_gapic_client_channel( - bigtable_admin_v2.BigtableInstanceAdminClient, + admin.BigtableInstanceAdminClient, BigtableInstanceAdminGrpcTransport, ) klass = _create_gapic_client( - bigtable_admin_v2.BigtableInstanceAdminClient, + admin.BigtableInstanceAdminClient, client_options=self._admin_client_options, transport=transport, ) diff --git a/google/cloud/bigtable/cluster.py b/google/cloud/bigtable/cluster.py index 11fb5492d..65a62cffa 100644 --- a/google/cloud/bigtable/cluster.py +++ b/google/cloud/bigtable/cluster.py @@ -16,7 +16,7 @@ import re -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin.types import instance from google.api_core.exceptions import NotFound from google.protobuf import field_mask_pb2 diff --git a/google/cloud/bigtable/column_family.py b/google/cloud/bigtable/column_family.py index 80232958d..93112abd8 100644 --- a/google/cloud/bigtable/column_family.py +++ b/google/cloud/bigtable/column_family.py @@ -16,8 +16,8 @@ from google.cloud import _helpers -from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 -from google.cloud.bigtable_admin_v2.types import ( +from google.cloud.bigtable.admin.types import table as table_v2_pb2 +from google.cloud.bigtable.admin.types import ( bigtable_table_admin as table_admin_v2_pb2, ) from google.api_core.gapic_v1.method import DEFAULT diff --git a/google/cloud/bigtable/enums.py b/google/cloud/bigtable/enums.py index 327b2f828..4df3569b4 100644 --- a/google/cloud/bigtable/enums.py +++ b/google/cloud/bigtable/enums.py @@ -13,9 +13,9 @@ # limitations under the License. """Wrappers for gapic enum types.""" -from google.cloud.bigtable_admin_v2.types import common -from google.cloud.bigtable_admin_v2.types import instance -from google.cloud.bigtable_admin_v2.types import table +from google.cloud.bigtable.admin.types import common +from google.cloud.bigtable.admin.types import instance +from google.cloud.bigtable.admin.types import table class StorageType(object): diff --git a/google/cloud/bigtable/instance.py b/google/cloud/bigtable/instance.py index 23fb1c95d..5a19654e5 100644 --- a/google/cloud/bigtable/instance.py +++ b/google/cloud/bigtable/instance.py @@ -22,7 +22,7 @@ from google.protobuf import field_mask_pb2 -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin.types import instance from google.iam.v1 import options_pb2 # type: ignore diff --git a/google/cloud/bigtable/table.py b/google/cloud/bigtable/table.py index 0009f287e..97d7322e9 100644 --- a/google/cloud/bigtable/table.py +++ b/google/cloud/bigtable/table.py @@ -47,9 +47,9 @@ from google.cloud.bigtable.row_set import RowRange from google.cloud.bigtable import enums from google.cloud.bigtable_v2.types import bigtable as data_messages_v2_pb2 -from google.cloud.bigtable_admin_v2 import BaseBigtableTableAdminClient -from google.cloud.bigtable_admin_v2.types import table as admin_messages_v2_pb2 -from google.cloud.bigtable_admin_v2.types import ( +from google.cloud.bigtable.admin import BigtableTableAdminClient +from google.cloud.bigtable.admin.types import table as admin_messages_v2_pb2 +from google.cloud.bigtable.admin.types import ( bigtable_table_admin as table_admin_messages_v2_pb2, ) @@ -990,7 +990,7 @@ def list_backups(self, cluster_id=None, filter_=None, order_by=None, page_size=0 if filter_: backups_filter = "({}) AND ({})".format(backups_filter, filter_) - parent = BaseBigtableTableAdminClient.cluster_path( + parent = BigtableTableAdminClient.cluster_path( project=self._instance._client.project, instance=self._instance.instance_id, cluster=cluster_id, @@ -1049,7 +1049,7 @@ def restore(self, new_table_id, cluster_id=None, backup_id=None, backup_name=Non """ api = self._instance._client.table_admin_client if not backup_name: - backup_name = BaseBigtableTableAdminClient.backup_path( + backup_name = BigtableTableAdminClient.backup_path( project=self._instance._client.project, instance=self._instance.instance_id, cluster=cluster_id, diff --git a/google/cloud/bigtable_admin/__init__.py b/google/cloud/bigtable_admin/__init__.py index 00353ea96..62f342a08 100644 --- a/google/cloud/bigtable_admin/__init__.py +++ b/google/cloud/bigtable_admin/__init__.py @@ -13,439 +13,24 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from google.cloud.bigtable_admin import gapic_version as package_version -__version__ = package_version.__version__ +import sys +import importlib +import pkgutil +import google.cloud.bigtable.admin -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.client import ( - BigtableInstanceAdminClient, -) -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.async_client import ( - BigtableInstanceAdminAsyncClient, -) -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin.client import ( - BaseBigtableTableAdminClient, -) -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin.async_client import ( - BaseBigtableTableAdminAsyncClient, -) +# Alias all subpackages of google.cloud.bigtable.admin to +# corresponding subpackages of google.cloud.bigtable_admin_v2. -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateAppProfileRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateClusterMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateClusterRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateInstanceMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateInstanceRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateLogicalViewMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateLogicalViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateMaterializedViewMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateMaterializedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - DeleteAppProfileRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - DeleteClusterRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - DeleteInstanceRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - DeleteLogicalViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - DeleteMaterializedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - GetAppProfileRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - GetClusterRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - GetInstanceRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - GetLogicalViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - GetMaterializedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListAppProfilesRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListAppProfilesResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListClustersRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListClustersResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListHotTabletsRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListHotTabletsResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListInstancesRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListInstancesResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListLogicalViewsRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListLogicalViewsResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListMaterializedViewsRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListMaterializedViewsResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - PartialUpdateClusterMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - PartialUpdateClusterRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - PartialUpdateInstanceRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateAppProfileMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateAppProfileRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateClusterMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateInstanceMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateLogicalViewMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateLogicalViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateMaterializedViewMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateMaterializedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CheckConsistencyRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CheckConsistencyResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import CopyBackupMetadata -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import CopyBackupRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateAuthorizedViewMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateAuthorizedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateBackupMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateBackupRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateSchemaBundleMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateSchemaBundleRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateTableFromSnapshotMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateTableFromSnapshotRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import CreateTableRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - DataBoostReadLocalWrites, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - DeleteAuthorizedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - DeleteBackupRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - DeleteSchemaBundleRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - DeleteSnapshotRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import DeleteTableRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - DropRowRangeRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - GenerateConsistencyTokenRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - GenerateConsistencyTokenResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - GetAuthorizedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import GetBackupRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - GetSchemaBundleRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import GetSnapshotRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import GetTableRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ListAuthorizedViewsRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ListAuthorizedViewsResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ListBackupsRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ListBackupsResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ListSchemaBundlesRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ListSchemaBundlesResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ListSnapshotsRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ListSnapshotsResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ListTablesRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ListTablesResponse -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ModifyColumnFamiliesRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - OptimizeRestoredTableMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - RestoreTableMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - RestoreTableRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - SnapshotTableMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - SnapshotTableRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - StandardReadRemoteWrites, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UndeleteTableMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UndeleteTableRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UpdateAuthorizedViewMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UpdateAuthorizedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UpdateBackupRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UpdateSchemaBundleMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UpdateSchemaBundleRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UpdateTableMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import UpdateTableRequest -from google.cloud.bigtable_admin_v2.types.common import OperationProgress -from google.cloud.bigtable_admin_v2.types.common import StorageType -from google.cloud.bigtable_admin_v2.types.instance import AppProfile -from google.cloud.bigtable_admin_v2.types.instance import AutoscalingLimits -from google.cloud.bigtable_admin_v2.types.instance import AutoscalingTargets -from google.cloud.bigtable_admin_v2.types.instance import Cluster -from google.cloud.bigtable_admin_v2.types.instance import HotTablet -from google.cloud.bigtable_admin_v2.types.instance import Instance -from google.cloud.bigtable_admin_v2.types.instance import LogicalView -from google.cloud.bigtable_admin_v2.types.instance import MaterializedView -from google.cloud.bigtable_admin_v2.types.table import AuthorizedView -from google.cloud.bigtable_admin_v2.types.table import Backup -from google.cloud.bigtable_admin_v2.types.table import BackupInfo -from google.cloud.bigtable_admin_v2.types.table import ChangeStreamConfig -from google.cloud.bigtable_admin_v2.types.table import ColumnFamily -from google.cloud.bigtable_admin_v2.types.table import EncryptionInfo -from google.cloud.bigtable_admin_v2.types.table import GcRule -from google.cloud.bigtable_admin_v2.types.table import ProtoSchema -from google.cloud.bigtable_admin_v2.types.table import RestoreInfo -from google.cloud.bigtable_admin_v2.types.table import SchemaBundle -from google.cloud.bigtable_admin_v2.types.table import Snapshot -from google.cloud.bigtable_admin_v2.types.table import Table -from google.cloud.bigtable_admin_v2.types.table import RestoreSourceType -from google.cloud.bigtable_admin_v2.types.types import Type +_NEW_PATH = "google.cloud.bigtable.admin" +sys.modules[__name__] = google.cloud.bigtable.admin -__all__ = ( - "BigtableInstanceAdminClient", - "BigtableInstanceAdminAsyncClient", - "BaseBigtableTableAdminClient", - "BaseBigtableTableAdminAsyncClient", - "CreateAppProfileRequest", - "CreateClusterMetadata", - "CreateClusterRequest", - "CreateInstanceMetadata", - "CreateInstanceRequest", - "CreateLogicalViewMetadata", - "CreateLogicalViewRequest", - "CreateMaterializedViewMetadata", - "CreateMaterializedViewRequest", - "DeleteAppProfileRequest", - "DeleteClusterRequest", - "DeleteInstanceRequest", - "DeleteLogicalViewRequest", - "DeleteMaterializedViewRequest", - "GetAppProfileRequest", - "GetClusterRequest", - "GetInstanceRequest", - "GetLogicalViewRequest", - "GetMaterializedViewRequest", - "ListAppProfilesRequest", - "ListAppProfilesResponse", - "ListClustersRequest", - "ListClustersResponse", - "ListHotTabletsRequest", - "ListHotTabletsResponse", - "ListInstancesRequest", - "ListInstancesResponse", - "ListLogicalViewsRequest", - "ListLogicalViewsResponse", - "ListMaterializedViewsRequest", - "ListMaterializedViewsResponse", - "PartialUpdateClusterMetadata", - "PartialUpdateClusterRequest", - "PartialUpdateInstanceRequest", - "UpdateAppProfileMetadata", - "UpdateAppProfileRequest", - "UpdateClusterMetadata", - "UpdateInstanceMetadata", - "UpdateLogicalViewMetadata", - "UpdateLogicalViewRequest", - "UpdateMaterializedViewMetadata", - "UpdateMaterializedViewRequest", - "CheckConsistencyRequest", - "CheckConsistencyResponse", - "CopyBackupMetadata", - "CopyBackupRequest", - "CreateAuthorizedViewMetadata", - "CreateAuthorizedViewRequest", - "CreateBackupMetadata", - "CreateBackupRequest", - "CreateSchemaBundleMetadata", - "CreateSchemaBundleRequest", - "CreateTableFromSnapshotMetadata", - "CreateTableFromSnapshotRequest", - "CreateTableRequest", - "DataBoostReadLocalWrites", - "DeleteAuthorizedViewRequest", - "DeleteBackupRequest", - "DeleteSchemaBundleRequest", - "DeleteSnapshotRequest", - "DeleteTableRequest", - "DropRowRangeRequest", - "GenerateConsistencyTokenRequest", - "GenerateConsistencyTokenResponse", - "GetAuthorizedViewRequest", - "GetBackupRequest", - "GetSchemaBundleRequest", - "GetSnapshotRequest", - "GetTableRequest", - "ListAuthorizedViewsRequest", - "ListAuthorizedViewsResponse", - "ListBackupsRequest", - "ListBackupsResponse", - "ListSchemaBundlesRequest", - "ListSchemaBundlesResponse", - "ListSnapshotsRequest", - "ListSnapshotsResponse", - "ListTablesRequest", - "ListTablesResponse", - "ModifyColumnFamiliesRequest", - "OptimizeRestoredTableMetadata", - "RestoreTableMetadata", - "RestoreTableRequest", - "SnapshotTableMetadata", - "SnapshotTableRequest", - "StandardReadRemoteWrites", - "UndeleteTableMetadata", - "UndeleteTableRequest", - "UpdateAuthorizedViewMetadata", - "UpdateAuthorizedViewRequest", - "UpdateBackupRequest", - "UpdateSchemaBundleMetadata", - "UpdateSchemaBundleRequest", - "UpdateTableMetadata", - "UpdateTableRequest", - "OperationProgress", - "StorageType", - "AppProfile", - "AutoscalingLimits", - "AutoscalingTargets", - "Cluster", - "HotTablet", - "Instance", - "LogicalView", - "MaterializedView", - "AuthorizedView", - "Backup", - "BackupInfo", - "ChangeStreamConfig", - "ColumnFamily", - "EncryptionInfo", - "GcRule", - "ProtoSchema", - "RestoreInfo", - "SchemaBundle", - "Snapshot", - "Table", - "RestoreSourceType", - "Type", -) - -import google.cloud.bigtable_admin_v2.overlay # noqa: F401 -from google.cloud.bigtable_admin_v2.overlay import * # noqa: F401, F403 - -__all__ += google.cloud.bigtable_admin_v2.overlay.__all__ +# iterate and import all submodules to populate sys.modules +for _, name, _ in pkgutil.walk_packages( + path=google.cloud.bigtable.admin.__path__, + prefix=_NEW_PATH + ".", +): + mod = importlib.import_module(name) + alias = name.replace(_NEW_PATH, __name__, 1) + sys.modules[alias] = mod diff --git a/google/cloud/bigtable_admin_v2/__init__.py b/google/cloud/bigtable_admin_v2/__init__.py index 713b2408f..62f342a08 100644 --- a/google/cloud/bigtable_admin_v2/__init__.py +++ b/google/cloud/bigtable_admin_v2/__init__.py @@ -13,262 +13,24 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from google.cloud.bigtable_admin_v2 import gapic_version as package_version -__version__ = package_version.__version__ +import sys +import importlib +import pkgutil +import google.cloud.bigtable.admin -from .services.bigtable_instance_admin import BigtableInstanceAdminClient -from .services.bigtable_instance_admin import BigtableInstanceAdminAsyncClient -from .services.bigtable_table_admin import BaseBigtableTableAdminClient -from .services.bigtable_table_admin import BaseBigtableTableAdminAsyncClient +# Alias all subpackages of google.cloud.bigtable.admin to +# corresponding subpackages of google.cloud.bigtable_admin_v2. -from .types.bigtable_instance_admin import CreateAppProfileRequest -from .types.bigtable_instance_admin import CreateClusterMetadata -from .types.bigtable_instance_admin import CreateClusterRequest -from .types.bigtable_instance_admin import CreateInstanceMetadata -from .types.bigtable_instance_admin import CreateInstanceRequest -from .types.bigtable_instance_admin import CreateLogicalViewMetadata -from .types.bigtable_instance_admin import CreateLogicalViewRequest -from .types.bigtable_instance_admin import CreateMaterializedViewMetadata -from .types.bigtable_instance_admin import CreateMaterializedViewRequest -from .types.bigtable_instance_admin import DeleteAppProfileRequest -from .types.bigtable_instance_admin import DeleteClusterRequest -from .types.bigtable_instance_admin import DeleteInstanceRequest -from .types.bigtable_instance_admin import DeleteLogicalViewRequest -from .types.bigtable_instance_admin import DeleteMaterializedViewRequest -from .types.bigtable_instance_admin import GetAppProfileRequest -from .types.bigtable_instance_admin import GetClusterRequest -from .types.bigtable_instance_admin import GetInstanceRequest -from .types.bigtable_instance_admin import GetLogicalViewRequest -from .types.bigtable_instance_admin import GetMaterializedViewRequest -from .types.bigtable_instance_admin import ListAppProfilesRequest -from .types.bigtable_instance_admin import ListAppProfilesResponse -from .types.bigtable_instance_admin import ListClustersRequest -from .types.bigtable_instance_admin import ListClustersResponse -from .types.bigtable_instance_admin import ListHotTabletsRequest -from .types.bigtable_instance_admin import ListHotTabletsResponse -from .types.bigtable_instance_admin import ListInstancesRequest -from .types.bigtable_instance_admin import ListInstancesResponse -from .types.bigtable_instance_admin import ListLogicalViewsRequest -from .types.bigtable_instance_admin import ListLogicalViewsResponse -from .types.bigtable_instance_admin import ListMaterializedViewsRequest -from .types.bigtable_instance_admin import ListMaterializedViewsResponse -from .types.bigtable_instance_admin import PartialUpdateClusterMetadata -from .types.bigtable_instance_admin import PartialUpdateClusterRequest -from .types.bigtable_instance_admin import PartialUpdateInstanceRequest -from .types.bigtable_instance_admin import UpdateAppProfileMetadata -from .types.bigtable_instance_admin import UpdateAppProfileRequest -from .types.bigtable_instance_admin import UpdateClusterMetadata -from .types.bigtable_instance_admin import UpdateInstanceMetadata -from .types.bigtable_instance_admin import UpdateLogicalViewMetadata -from .types.bigtable_instance_admin import UpdateLogicalViewRequest -from .types.bigtable_instance_admin import UpdateMaterializedViewMetadata -from .types.bigtable_instance_admin import UpdateMaterializedViewRequest -from .types.bigtable_table_admin import CheckConsistencyRequest -from .types.bigtable_table_admin import CheckConsistencyResponse -from .types.bigtable_table_admin import CopyBackupMetadata -from .types.bigtable_table_admin import CopyBackupRequest -from .types.bigtable_table_admin import CreateAuthorizedViewMetadata -from .types.bigtable_table_admin import CreateAuthorizedViewRequest -from .types.bigtable_table_admin import CreateBackupMetadata -from .types.bigtable_table_admin import CreateBackupRequest -from .types.bigtable_table_admin import CreateSchemaBundleMetadata -from .types.bigtable_table_admin import CreateSchemaBundleRequest -from .types.bigtable_table_admin import CreateTableFromSnapshotMetadata -from .types.bigtable_table_admin import CreateTableFromSnapshotRequest -from .types.bigtable_table_admin import CreateTableRequest -from .types.bigtable_table_admin import DataBoostReadLocalWrites -from .types.bigtable_table_admin import DeleteAuthorizedViewRequest -from .types.bigtable_table_admin import DeleteBackupRequest -from .types.bigtable_table_admin import DeleteSchemaBundleRequest -from .types.bigtable_table_admin import DeleteSnapshotRequest -from .types.bigtable_table_admin import DeleteTableRequest -from .types.bigtable_table_admin import DropRowRangeRequest -from .types.bigtable_table_admin import GenerateConsistencyTokenRequest -from .types.bigtable_table_admin import GenerateConsistencyTokenResponse -from .types.bigtable_table_admin import GetAuthorizedViewRequest -from .types.bigtable_table_admin import GetBackupRequest -from .types.bigtable_table_admin import GetSchemaBundleRequest -from .types.bigtable_table_admin import GetSnapshotRequest -from .types.bigtable_table_admin import GetTableRequest -from .types.bigtable_table_admin import ListAuthorizedViewsRequest -from .types.bigtable_table_admin import ListAuthorizedViewsResponse -from .types.bigtable_table_admin import ListBackupsRequest -from .types.bigtable_table_admin import ListBackupsResponse -from .types.bigtable_table_admin import ListSchemaBundlesRequest -from .types.bigtable_table_admin import ListSchemaBundlesResponse -from .types.bigtable_table_admin import ListSnapshotsRequest -from .types.bigtable_table_admin import ListSnapshotsResponse -from .types.bigtable_table_admin import ListTablesRequest -from .types.bigtable_table_admin import ListTablesResponse -from .types.bigtable_table_admin import ModifyColumnFamiliesRequest -from .types.bigtable_table_admin import OptimizeRestoredTableMetadata -from .types.bigtable_table_admin import RestoreTableMetadata -from .types.bigtable_table_admin import RestoreTableRequest -from .types.bigtable_table_admin import SnapshotTableMetadata -from .types.bigtable_table_admin import SnapshotTableRequest -from .types.bigtable_table_admin import StandardReadRemoteWrites -from .types.bigtable_table_admin import UndeleteTableMetadata -from .types.bigtable_table_admin import UndeleteTableRequest -from .types.bigtable_table_admin import UpdateAuthorizedViewMetadata -from .types.bigtable_table_admin import UpdateAuthorizedViewRequest -from .types.bigtable_table_admin import UpdateBackupRequest -from .types.bigtable_table_admin import UpdateSchemaBundleMetadata -from .types.bigtable_table_admin import UpdateSchemaBundleRequest -from .types.bigtable_table_admin import UpdateTableMetadata -from .types.bigtable_table_admin import UpdateTableRequest -from .types.common import OperationProgress -from .types.common import StorageType -from .types.instance import AppProfile -from .types.instance import AutoscalingLimits -from .types.instance import AutoscalingTargets -from .types.instance import Cluster -from .types.instance import HotTablet -from .types.instance import Instance -from .types.instance import LogicalView -from .types.instance import MaterializedView -from .types.table import AuthorizedView -from .types.table import Backup -from .types.table import BackupInfo -from .types.table import ChangeStreamConfig -from .types.table import ColumnFamily -from .types.table import EncryptionInfo -from .types.table import GcRule -from .types.table import ProtoSchema -from .types.table import RestoreInfo -from .types.table import SchemaBundle -from .types.table import Snapshot -from .types.table import Table -from .types.table import RestoreSourceType -from .types.types import Type +_NEW_PATH = "google.cloud.bigtable.admin" +sys.modules[__name__] = google.cloud.bigtable.admin -__all__ = ( - "BaseBigtableTableAdminAsyncClient", - "BigtableInstanceAdminAsyncClient", - "AppProfile", - "AuthorizedView", - "AutoscalingLimits", - "AutoscalingTargets", - "Backup", - "BackupInfo", - "BaseBigtableTableAdminClient", - "BigtableInstanceAdminClient", - "ChangeStreamConfig", - "CheckConsistencyRequest", - "CheckConsistencyResponse", - "Cluster", - "ColumnFamily", - "CopyBackupMetadata", - "CopyBackupRequest", - "CreateAppProfileRequest", - "CreateAuthorizedViewMetadata", - "CreateAuthorizedViewRequest", - "CreateBackupMetadata", - "CreateBackupRequest", - "CreateClusterMetadata", - "CreateClusterRequest", - "CreateInstanceMetadata", - "CreateInstanceRequest", - "CreateLogicalViewMetadata", - "CreateLogicalViewRequest", - "CreateMaterializedViewMetadata", - "CreateMaterializedViewRequest", - "CreateSchemaBundleMetadata", - "CreateSchemaBundleRequest", - "CreateTableFromSnapshotMetadata", - "CreateTableFromSnapshotRequest", - "CreateTableRequest", - "DataBoostReadLocalWrites", - "DeleteAppProfileRequest", - "DeleteAuthorizedViewRequest", - "DeleteBackupRequest", - "DeleteClusterRequest", - "DeleteInstanceRequest", - "DeleteLogicalViewRequest", - "DeleteMaterializedViewRequest", - "DeleteSchemaBundleRequest", - "DeleteSnapshotRequest", - "DeleteTableRequest", - "DropRowRangeRequest", - "EncryptionInfo", - "GcRule", - "GenerateConsistencyTokenRequest", - "GenerateConsistencyTokenResponse", - "GetAppProfileRequest", - "GetAuthorizedViewRequest", - "GetBackupRequest", - "GetClusterRequest", - "GetInstanceRequest", - "GetLogicalViewRequest", - "GetMaterializedViewRequest", - "GetSchemaBundleRequest", - "GetSnapshotRequest", - "GetTableRequest", - "HotTablet", - "Instance", - "ListAppProfilesRequest", - "ListAppProfilesResponse", - "ListAuthorizedViewsRequest", - "ListAuthorizedViewsResponse", - "ListBackupsRequest", - "ListBackupsResponse", - "ListClustersRequest", - "ListClustersResponse", - "ListHotTabletsRequest", - "ListHotTabletsResponse", - "ListInstancesRequest", - "ListInstancesResponse", - "ListLogicalViewsRequest", - "ListLogicalViewsResponse", - "ListMaterializedViewsRequest", - "ListMaterializedViewsResponse", - "ListSchemaBundlesRequest", - "ListSchemaBundlesResponse", - "ListSnapshotsRequest", - "ListSnapshotsResponse", - "ListTablesRequest", - "ListTablesResponse", - "LogicalView", - "MaterializedView", - "ModifyColumnFamiliesRequest", - "OperationProgress", - "OptimizeRestoredTableMetadata", - "PartialUpdateClusterMetadata", - "PartialUpdateClusterRequest", - "PartialUpdateInstanceRequest", - "ProtoSchema", - "RestoreInfo", - "RestoreSourceType", - "RestoreTableMetadata", - "RestoreTableRequest", - "SchemaBundle", - "Snapshot", - "SnapshotTableMetadata", - "SnapshotTableRequest", - "StandardReadRemoteWrites", - "StorageType", - "Table", - "Type", - "UndeleteTableMetadata", - "UndeleteTableRequest", - "UpdateAppProfileMetadata", - "UpdateAppProfileRequest", - "UpdateAuthorizedViewMetadata", - "UpdateAuthorizedViewRequest", - "UpdateBackupRequest", - "UpdateClusterMetadata", - "UpdateInstanceMetadata", - "UpdateLogicalViewMetadata", - "UpdateLogicalViewRequest", - "UpdateMaterializedViewMetadata", - "UpdateMaterializedViewRequest", - "UpdateSchemaBundleMetadata", - "UpdateSchemaBundleRequest", - "UpdateTableMetadata", - "UpdateTableRequest", -) - -from .overlay import * # noqa: F403 - -__all__ += overlay.__all__ # noqa: F405 +# iterate and import all submodules to populate sys.modules +for _, name, _ in pkgutil.walk_packages( + path=google.cloud.bigtable.admin.__path__, + prefix=_NEW_PATH + ".", +): + mod = importlib.import_module(name) + alias = name.replace(_NEW_PATH, __name__, 1) + sys.modules[alias] = mod diff --git a/google/cloud/bigtable_admin_v2/gapic_version.py b/google/cloud/bigtable_admin_v2/gapic_version.py deleted file mode 100644 index 0c5de5c03..000000000 --- a/google/cloud/bigtable_admin_v2/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "2.33.0" # {x-release-please-version} diff --git a/google/cloud/bigtable_admin_v2/py.typed b/google/cloud/bigtable_admin_v2/py.typed deleted file mode 100644 index bc26f2069..000000000 --- a/google/cloud/bigtable_admin_v2/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-cloud-bigtable-admin package uses inline types. diff --git a/owlbot.py b/owlbot.py index b6b741b54..68972befc 100644 --- a/owlbot.py +++ b/owlbot.py @@ -76,7 +76,6 @@ def get_staging_dirs( # in a Github PR. We use these flags to only do those operations # on fresh copies of files found in googleapis-gen, and not on user-submitted # changes. -is_fresh_admin_copy = False is_fresh_admin_v2_copy = False is_fresh_admin_docs_copy = False @@ -86,15 +85,15 @@ def get_staging_dirs( s.move(library / "scripts") for library in get_staging_dirs(bigtable_admin_default_version, "bigtable_admin"): - is_fresh_admin_copy = \ - s.move(library / "google/cloud/bigtable_admin", excludes=["**/gapic_version.py"]) is_fresh_admin_v2_copy = \ - s.move(library / "google/cloud/bigtable_admin_v2", excludes=["**/gapic_version.py"]) - s.move(library / "tests") + s.move(library / "google/cloud/bigtable/admin_v2", + destination="google/cloud/bigtable/admin", + excludes=["**/gapic_version.py"]) + s.move(library / "tests/unit/gapic/admin_v2", destination="tests/unit/gapic/admin") s.move(library / "samples") s.move(library / "scripts") is_fresh_admin_docs_copy = \ - s.move(library / "docs/bigtable_admin_v2", destination="docs/admin_client") + s.move(library / "docs/admin_v2", destination="docs/admin_client") s.remove_staging_dirs() @@ -175,7 +174,7 @@ def get_staging_dirs( # Admin Overlay work # -------------------------------------------------------------------------- -# Add overlay imports to top level __init__.py files in admin_v2 and admin at the end +# Add overlay imports to top level __init__.py files in admin at the end # of each file, after the __all__ definition. These changes should only be done on fresh # copies of the __init__.py files. def add_overlay_to_init_py(init_py_location, import_statements, should_add): @@ -186,39 +185,64 @@ def add_overlay_to_init_py(init_py_location, import_statements, should_add): r"\1\n\n" + import_statements ) + add_overlay_to_init_py( - "google/cloud/bigtable_admin_v2/__init__.py", + "google/cloud/bigtable/admin/__init__.py", """from .overlay import * # noqa: F403 __all__ += overlay.__all__ # noqa: F405 """, is_fresh_admin_v2_copy, ) -add_overlay_to_init_py( - "google/cloud/bigtable_admin/__init__.py", - """import google.cloud.bigtable_admin_v2.overlay # noqa: F401 -from google.cloud.bigtable_admin_v2.overlay import * # noqa: F401, F403 +# Because we are moving google/bigtable/admin_v2 in googleapis to google/cloud/bigtable/admin, +# and because of selective GAPIC, we need to modify the samples in the autogenerated samples and +# docstrings. We will fix samples by: +# 1. Replacing all instances of admin_v2 with admin in the samples, code, and autogen doc pipeline. +# 2. Replacing all instances of BaseBigtableTableAdminClient/BaseBigtableAdminAsyncClient with +# BigtableTableAdminClient/BigtableTableAdminAsyncClient. +s.replace( + [ + "google/cloud/bigtable/admin/services/**/*.py", + "google/cloud/bigtable/admin/types/*.py", + "google/cloud/bigtable/admin/__init__.py", + "docs/admin_client/*.rst", + "tests/unit/gapic/admin/test_*.py", + ], + "admin_v2", + "admin" +) -__all__ += google.cloud.bigtable_admin_v2.overlay.__all__ -""", - is_fresh_admin_copy, +# Need to be more careful replacing in samples files to not alter region tag names. +s.replace( + [ + "samples/generated_samples/bigtableadmin_v2_*.py", + "samples/generated_samples/snippet_metadata_google.bigtable.admin.v2.json", + ], + "(? Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class bigtable_adminCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'check_consistency': ('name', 'consistency_token', 'standard_read_remote_writes', 'data_boost_read_local_writes', ), - 'copy_backup': ('parent', 'backup_id', 'source_backup', 'expire_time', ), - 'create_app_profile': ('parent', 'app_profile_id', 'app_profile', 'ignore_warnings', ), - 'create_authorized_view': ('parent', 'authorized_view_id', 'authorized_view', ), - 'create_backup': ('parent', 'backup_id', 'backup', ), - 'create_cluster': ('parent', 'cluster_id', 'cluster', ), - 'create_instance': ('parent', 'instance_id', 'instance', 'clusters', ), - 'create_logical_view': ('parent', 'logical_view_id', 'logical_view', ), - 'create_materialized_view': ('parent', 'materialized_view_id', 'materialized_view', ), - 'create_schema_bundle': ('parent', 'schema_bundle_id', 'schema_bundle', ), - 'create_table': ('parent', 'table_id', 'table', 'initial_splits', ), - 'create_table_from_snapshot': ('parent', 'table_id', 'source_snapshot', ), - 'delete_app_profile': ('name', 'ignore_warnings', ), - 'delete_authorized_view': ('name', 'etag', ), - 'delete_backup': ('name', ), - 'delete_cluster': ('name', ), - 'delete_instance': ('name', ), - 'delete_logical_view': ('name', 'etag', ), - 'delete_materialized_view': ('name', 'etag', ), - 'delete_schema_bundle': ('name', 'etag', ), - 'delete_snapshot': ('name', ), - 'delete_table': ('name', ), - 'drop_row_range': ('name', 'row_key_prefix', 'delete_all_data_from_table', ), - 'generate_consistency_token': ('name', ), - 'get_app_profile': ('name', ), - 'get_authorized_view': ('name', 'view', ), - 'get_backup': ('name', ), - 'get_cluster': ('name', ), - 'get_iam_policy': ('resource', 'options', ), - 'get_instance': ('name', ), - 'get_logical_view': ('name', ), - 'get_materialized_view': ('name', ), - 'get_schema_bundle': ('name', ), - 'get_snapshot': ('name', ), - 'get_table': ('name', 'view', ), - 'list_app_profiles': ('parent', 'page_size', 'page_token', ), - 'list_authorized_views': ('parent', 'page_size', 'page_token', 'view', ), - 'list_backups': ('parent', 'filter', 'order_by', 'page_size', 'page_token', ), - 'list_clusters': ('parent', 'page_token', ), - 'list_hot_tablets': ('parent', 'start_time', 'end_time', 'page_size', 'page_token', ), - 'list_instances': ('parent', 'page_token', ), - 'list_logical_views': ('parent', 'page_size', 'page_token', ), - 'list_materialized_views': ('parent', 'page_size', 'page_token', ), - 'list_schema_bundles': ('parent', 'page_size', 'page_token', ), - 'list_snapshots': ('parent', 'page_size', 'page_token', ), - 'list_tables': ('parent', 'view', 'page_size', 'page_token', ), - 'modify_column_families': ('name', 'modifications', 'ignore_warnings', ), - 'partial_update_cluster': ('cluster', 'update_mask', ), - 'partial_update_instance': ('instance', 'update_mask', ), - 'restore_table': ('parent', 'table_id', 'backup', ), - 'set_iam_policy': ('resource', 'policy', 'update_mask', ), - 'snapshot_table': ('name', 'cluster', 'snapshot_id', 'ttl', 'description', ), - 'test_iam_permissions': ('resource', 'permissions', ), - 'undelete_table': ('name', ), - 'update_app_profile': ('app_profile', 'update_mask', 'ignore_warnings', ), - 'update_authorized_view': ('authorized_view', 'update_mask', 'ignore_warnings', ), - 'update_backup': ('backup', 'update_mask', ), - 'update_cluster': ('name', 'location', 'state', 'serve_nodes', 'node_scaling_factor', 'cluster_config', 'default_storage_type', 'encryption_config', ), - 'update_instance': ('display_name', 'name', 'state', 'type_', 'labels', 'create_time', 'satisfies_pzs', 'satisfies_pzi', 'tags', ), - 'update_logical_view': ('logical_view', 'update_mask', ), - 'update_materialized_view': ('materialized_view', 'update_mask', ), - 'update_schema_bundle': ('schema_bundle', 'update_mask', 'ignore_warnings', ), - 'update_table': ('table', 'update_mask', 'ignore_warnings', ), - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=bigtable_adminCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the bigtable_admin client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/tests/system/admin_overlay/test_system_async.py b/tests/system/admin_overlay/test_system_async.py index aa412569e..185e69af3 100644 --- a/tests/system/admin_overlay/test_system_async.py +++ b/tests/system/admin_overlay/test_system_async.py @@ -14,7 +14,7 @@ from typing import Tuple -from google.cloud import bigtable_admin_v2 as admin_v2 +from google.cloud.bigtable import admin from google.cloud.bigtable.data._cross_sync import CrossSync from google.cloud.bigtable.data import mutations, read_rows_query from google.cloud.environment_vars import BIGTABLE_EMULATOR @@ -68,7 +68,7 @@ async def data_client(admin_overlay_project_id): ) @CrossSync.pytest_fixture(scope="session") async def table_admin_client(admin_overlay_project_id): - async with admin_v2.BigtableTableAdminAsyncClient( + async with admin.BigtableTableAdminAsyncClient( client_options={ "quota_project_id": admin_overlay_project_id, } @@ -81,7 +81,7 @@ async def table_admin_client(admin_overlay_project_id): ) @CrossSync.pytest_fixture(scope="session") async def instance_admin_client(admin_overlay_project_id): - async with admin_v2.BigtableInstanceAdminAsyncClient( + async with admin.BigtableInstanceAdminAsyncClient( client_options={ "quota_project_id": admin_overlay_project_id, } @@ -120,9 +120,9 @@ async def create_instance( data_client, project_id, instances_to_delete, - storage_type=admin_v2.StorageType.HDD, + storage_type=admin.StorageType.HDD, cluster_locations=DEFAULT_CLUSTER_LOCATIONS, -) -> Tuple[admin_v2.Instance, admin_v2.Table]: +) -> Tuple[admin.Instance, admin.Table]: """ Creates a new Bigtable instance with the specified project_id, storage type, and cluster locations. @@ -135,7 +135,7 @@ async def create_instance( instance_id = generate_unique_suffix(INSTANCE_PREFIX) for idx, location in enumerate(cluster_locations): - clusters[location] = admin_v2.Cluster( + clusters[location] = admin.Cluster( name=instance_admin_client.cluster_path( project_id, instance_id, f"{instance_id}-{idx}" ), @@ -146,14 +146,14 @@ async def create_instance( # Instance and cluster creation are currently unsupported in the Bigtable emulator if os.getenv(BIGTABLE_EMULATOR): # All we need for system tests so far is the instance name. - instance = admin_v2.Instance( + instance = admin.Instance( name=instance_admin_client.instance_path(project_id, instance_id), ) else: - create_instance_request = admin_v2.CreateInstanceRequest( + create_instance_request = admin.CreateInstanceRequest( parent=instance_admin_client.common_project_path(project_id), instance_id=instance_id, - instance=admin_v2.Instance( + instance=admin.Instance( display_name=instance_id[ :30 ], # truncate to 30 characters because of character limit @@ -166,12 +166,12 @@ async def create_instance( instances_to_delete.append(instance) # Create a table within the instance - create_table_request = admin_v2.CreateTableRequest( + create_table_request = admin.CreateTableRequest( parent=instance_admin_client.instance_path(project_id, instance_id), table_id=TEST_TABLE_NAME, - table=admin_v2.Table( + table=admin.Table( column_families={ - TEST_COLUMMN_FAMILY_NAME: admin_v2.ColumnFamily(), + TEST_COLUMMN_FAMILY_NAME: admin.ColumnFamily(), } ), ) @@ -220,7 +220,7 @@ async def populate_table(table_admin_client, data_client, instance, table, cell_ @CrossSync.convert async def create_backup( instance_admin_client, table_admin_client, instance, table, backups_to_delete -) -> admin_v2.Backup: +) -> admin.Backup: """ Creates a backup of the given table under the given instance. @@ -237,10 +237,10 @@ async def create_backup( # Create the backup operation = await table_admin_client.create_backup( - admin_v2.CreateBackupRequest( + admin.CreateBackupRequest( parent=cluster_name, backup_id=backup_id, - backup=admin_v2.Backup( + backup=admin.Backup( name=f"{cluster_name}/backups/{backup_id}", source_table=table.name, expire_time=datetime.now() + timedelta(hours=7), @@ -286,8 +286,8 @@ async def assert_table_cell_value_equal_to( @pytest.mark.parametrize( "second_instance_storage_type,expect_optimize_operation", [ - (admin_v2.StorageType.HDD, False), - (admin_v2.StorageType.SSD, True), + (admin.StorageType.HDD, False), + (admin.StorageType.SSD, True), ], ) async def test_optimize_restored_table( @@ -309,7 +309,7 @@ async def test_optimize_restored_table( data_client, admin_overlay_project_id, instances_to_delete, - admin_v2.StorageType.HDD, + admin.StorageType.HDD, ) instance_to_restore, _ = await create_instance( @@ -331,14 +331,14 @@ async def test_optimize_restored_table( # Restore to other instance restore_operation = await table_admin_client.restore_table( - admin_v2.RestoreTableRequest( + admin.RestoreTableRequest( parent=instance_to_restore.name, table_id=TEST_BACKUP_TABLE_NAME, backup=backup.name, ) ) - assert isinstance(restore_operation, admin_v2.AsyncRestoreTableOperation) + assert isinstance(restore_operation, admin.AsyncRestoreTableOperation) restored_table = await restore_operation.result() optimize_operation = await restore_operation.optimize_restored_table_operation() @@ -385,9 +385,9 @@ async def test_wait_for_consistency( table_admin_client, data_client, instance, table, NEW_CELL_VALUE ) - wait_for_consistency_request = admin_v2.WaitForConsistencyRequest( + wait_for_consistency_request = admin.WaitForConsistencyRequest( name=table.name, - standard_read_remote_writes=admin_v2.StandardReadRemoteWrites(), + standard_read_remote_writes=admin.StandardReadRemoteWrites(), ) await table_admin_client.wait_for_consistency(wait_for_consistency_request) await assert_table_cell_value_equal_to( diff --git a/tests/system/admin_overlay/test_system_autogen.py b/tests/system/admin_overlay/test_system_autogen.py index 4fde3571f..9a8f9ba26 100644 --- a/tests/system/admin_overlay/test_system_autogen.py +++ b/tests/system/admin_overlay/test_system_autogen.py @@ -16,7 +16,7 @@ # This file is automatically generated by CrossSync. Do not edit manually. from typing import Tuple -from google.cloud import bigtable_admin_v2 as admin_v2 +from google.cloud.bigtable import admin from google.cloud.bigtable.data._cross_sync import CrossSync from google.cloud.bigtable.data import mutations, read_rows_query from google.cloud.environment_vars import BIGTABLE_EMULATOR @@ -55,7 +55,7 @@ def data_client(admin_overlay_project_id): @pytest.fixture(scope="session") def table_admin_client(admin_overlay_project_id): - with admin_v2.BigtableTableAdminClient( + with admin.BigtableTableAdminClient( client_options={"quota_project_id": admin_overlay_project_id} ) as client: yield client @@ -63,7 +63,7 @@ def table_admin_client(admin_overlay_project_id): @pytest.fixture(scope="session") def instance_admin_client(admin_overlay_project_id): - with admin_v2.BigtableInstanceAdminClient( + with admin.BigtableInstanceAdminClient( client_options={"quota_project_id": admin_overlay_project_id} ) as client: yield client @@ -95,9 +95,9 @@ def create_instance( data_client, project_id, instances_to_delete, - storage_type=admin_v2.StorageType.HDD, + storage_type=admin.StorageType.HDD, cluster_locations=DEFAULT_CLUSTER_LOCATIONS, -) -> Tuple[admin_v2.Instance, admin_v2.Table]: +) -> Tuple[admin.Instance, admin.Table]: """Creates a new Bigtable instance with the specified project_id, storage type, and cluster locations. After creating the Bigtable instance, it will create a test table and populate it with dummy data. @@ -106,7 +106,7 @@ def create_instance( clusters = {} instance_id = generate_unique_suffix(INSTANCE_PREFIX) for idx, location in enumerate(cluster_locations): - clusters[location] = admin_v2.Cluster( + clusters[location] = admin.Cluster( name=instance_admin_client.cluster_path( project_id, instance_id, f"{instance_id}-{idx}" ), @@ -114,24 +114,24 @@ def create_instance( default_storage_type=storage_type, ) if os.getenv(BIGTABLE_EMULATOR): - instance = admin_v2.Instance( + instance = admin.Instance( name=instance_admin_client.instance_path(project_id, instance_id) ) else: - create_instance_request = admin_v2.CreateInstanceRequest( + create_instance_request = admin.CreateInstanceRequest( parent=instance_admin_client.common_project_path(project_id), instance_id=instance_id, - instance=admin_v2.Instance(display_name=instance_id[:30]), + instance=admin.Instance(display_name=instance_id[:30]), clusters=clusters, ) operation = instance_admin_client.create_instance(create_instance_request) instance = operation.result() instances_to_delete.append(instance) - create_table_request = admin_v2.CreateTableRequest( + create_table_request = admin.CreateTableRequest( parent=instance_admin_client.instance_path(project_id, instance_id), table_id=TEST_TABLE_NAME, - table=admin_v2.Table( - column_families={TEST_COLUMMN_FAMILY_NAME: admin_v2.ColumnFamily()} + table=admin.Table( + column_families={TEST_COLUMMN_FAMILY_NAME: admin.ColumnFamily()} ), ) table = table_admin_client.create_table(create_table_request) @@ -168,7 +168,7 @@ def populate_table(table_admin_client, data_client, instance, table, cell_value) def create_backup( instance_admin_client, table_admin_client, instance, table, backups_to_delete -) -> admin_v2.Backup: +) -> admin.Backup: """Creates a backup of the given table under the given instance. This will be restored to a different instance later on, to test @@ -177,10 +177,10 @@ def create_backup( cluster_name = list_clusters_response.clusters[0].name backup_id = generate_unique_suffix(BACKUP_PREFIX) operation = table_admin_client.create_backup( - admin_v2.CreateBackupRequest( + admin.CreateBackupRequest( parent=cluster_name, backup_id=backup_id, - backup=admin_v2.Backup( + backup=admin.Backup( name=f"{cluster_name}/backups/{backup_id}", source_table=table.name, expire_time=datetime.now() + timedelta(hours=7), @@ -212,7 +212,7 @@ def assert_table_cell_value_equal_to( ) @pytest.mark.parametrize( "second_instance_storage_type,expect_optimize_operation", - [(admin_v2.StorageType.HDD, False), (admin_v2.StorageType.SSD, True)], + [(admin.StorageType.HDD, False), (admin.StorageType.SSD, True)], ) def test_optimize_restored_table( admin_overlay_project_id, @@ -230,7 +230,7 @@ def test_optimize_restored_table( data_client, admin_overlay_project_id, instances_to_delete, - admin_v2.StorageType.HDD, + admin.StorageType.HDD, ) (instance_to_restore, _) = create_instance( instance_admin_client, @@ -248,13 +248,13 @@ def test_optimize_restored_table( backups_to_delete, ) restore_operation = table_admin_client.restore_table( - admin_v2.RestoreTableRequest( + admin.RestoreTableRequest( parent=instance_to_restore.name, table_id=TEST_BACKUP_TABLE_NAME, backup=backup.name, ) ) - assert isinstance(restore_operation, admin_v2.RestoreTableOperation) + assert isinstance(restore_operation, admin.RestoreTableOperation) restored_table = restore_operation.result() optimize_operation = restore_operation.optimize_restored_table_operation() if expect_optimize_operation: @@ -291,8 +291,8 @@ def test_wait_for_consistency( cluster_locations=REPLICATION_CLUSTER_LOCATIONS, ) populate_table(table_admin_client, data_client, instance, table, NEW_CELL_VALUE) - wait_for_consistency_request = admin_v2.WaitForConsistencyRequest( - name=table.name, standard_read_remote_writes=admin_v2.StandardReadRemoteWrites() + wait_for_consistency_request = admin.WaitForConsistencyRequest( + name=table.name, standard_read_remote_writes=admin.StandardReadRemoteWrites() ) table_admin_client.wait_for_consistency(wait_for_consistency_request) assert_table_cell_value_equal_to( diff --git a/tests/unit/admin_overlay/my_oneof_message.py b/tests/unit/admin_overlay/my_oneof_message.py index 25667cfca..f8d644466 100644 --- a/tests/unit/admin_overlay/my_oneof_message.py +++ b/tests/unit/admin_overlay/my_oneof_message.py @@ -15,7 +15,7 @@ # import proto -from google.cloud.bigtable_admin_v2.utils import oneof_message +from google.cloud.bigtable.admin.utils import oneof_message __protobuf__ = proto.module( package="test.oneof.v1", diff --git a/tests/unit/admin_overlay/test_admin_packaging.py b/tests/unit/admin_overlay/test_admin_packaging.py index 729a92b5c..4a0caca83 100644 --- a/tests/unit/admin_overlay/test_admin_packaging.py +++ b/tests/unit/admin_overlay/test_admin_packaging.py @@ -18,18 +18,26 @@ @pytest.mark.parametrize( - "module", ["google.cloud.bigtable_admin", "google.cloud.bigtable_admin_v2"] + "module", + [ + # Previous locations of admin API + "google.cloud.bigtable_admin", + "google.cloud.bigtable_admin_v2", + # New locations of admin API + "google.cloud.bigtable.admin", + ], ) -def test_admin_overlay_imports(module): - # Simulate from import dynamically using importlib +def test_admin_overlay_object_imports(module): + # Simulate from import dynamically using importlib mod = importlib.import_module(module) # Check that the import aliasing works as expected for overlay/autogenerated clients/types. classes_to_modules = { - "BigtableTableAdminClient": "google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.client", - "RestoreTableOperation": "google.cloud.bigtable_admin_v2.overlay.types.restore_table", - "BigtableInstanceAdminClient": "google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.client", - "RestoreTableRequest": "google.cloud.bigtable_admin_v2.types.bigtable_table_admin", + "BigtableTableAdminClient": "google.cloud.bigtable.admin.overlay.services.bigtable_table_admin.client", + "BigtableInstanceAdminClient": "google.cloud.bigtable.admin.services.bigtable_instance_admin.client", + "RestoreTableOperation": "google.cloud.bigtable.admin.overlay.types.restore_table", + "BigtableInstanceAdminClient": "google.cloud.bigtable.admin.services.bigtable_instance_admin.client", + "RestoreTableRequest": "google.cloud.bigtable.admin.types.bigtable_table_admin", } for cls_name, submodule_name in classes_to_modules.items(): @@ -39,3 +47,75 @@ def test_admin_overlay_imports(module): # Check that from import * has the class inside. assert cls_name in mod.__all__ + + +@pytest.mark.parametrize( + "alias,actual", + [ + ( + "google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers", + "google.cloud.bigtable.admin.services.bigtable_instance_admin.pagers", + ), + ( + "google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports", + "google.cloud.bigtable.admin.services.bigtable_table_admin.transports", + ), + ( + "google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.client", + "google.cloud.bigtable.admin.overlay.services.bigtable_table_admin.client", + ), + ( + "google.cloud.bigtable_admin_v2.overlay.types.async_consistency", + "google.cloud.bigtable.admin.overlay.types.async_consistency", + ), + ], +) +def test_admin_shim_import_aliasing_subpackages(alias, actual): + # Simulates "import " dynamically using importlib + assert importlib.import_module(alias) == importlib.import_module(actual) + + # Simulates "from google.cloud.bigtable_admin_v2. import " + package, module = alias.rsplit(".", 1) + assert importlib.import_module( + f".{module}", package=package + ) == importlib.import_module(actual) + + +@pytest.mark.parametrize( + "alias,cls_name,subpackage_location", + [ + ( + "google.cloud.bigtable_admin_v2.types", + "GcRule", + "google.cloud.bigtable.admin.types.table", + ), + ( + "google.cloud.bigtable_admin_v2.services.bigtable_instance_admin", + "BigtableInstanceAdminAsyncClient", + "google.cloud.bigtable.admin.services.bigtable_instance_admin.async_client", + ), + ( + "google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin", + "BigtableTableAdminClient", + "google.cloud.bigtable.admin.overlay.services.bigtable_table_admin.client", + ), + ( + "google.cloud.bigtable_admin_v2.overlay.types", + "RestoreTableOperation", + "google.cloud.bigtable.admin.overlay.types.restore_table", + ), + ], +) +def test_admin_shim_services_types_subpackage_aliasing( + alias, cls_name, subpackage_location +): + # Because of existing aliasing on the types/service subpackages in google.cloud.bigtable.admin_v2, + # we need to see if this works with google.cloud.bigtable_admin_v2. + + # Simulate both from google.cloud.bigtable_admin_v2. import + # and import google.cloud.bigtable_admin_v2. dynamically using importlib + alias_mod = importlib.import_module(alias) + cls = getattr(alias_mod, cls_name) + subpackage = importlib.import_module(subpackage_location) + assert cls == getattr(subpackage, cls_name) + assert cls_name in alias_mod.__all__ diff --git a/tests/unit/admin_overlay/test_async_client.py b/tests/unit/admin_overlay/test_async_client.py index 0d844a9e4..39122f55e 100644 --- a/tests/unit/admin_overlay/test_async_client.py +++ b/tests/unit/admin_overlay/test_async_client.py @@ -24,13 +24,13 @@ from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth.credentials import AnonymousCredentials -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import transports -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.async_client import ( +from google.cloud.bigtable.admin.services.bigtable_table_admin import transports +from google.cloud.bigtable.admin.types import bigtable_table_admin +from google.cloud.bigtable.admin.overlay.services.bigtable_table_admin.async_client import ( BigtableTableAdminAsyncClient, DEFAULT_CLIENT_INFO, ) -from google.cloud.bigtable_admin_v2.overlay.types import ( +from google.cloud.bigtable.admin.overlay.types import ( async_restore_table, wait_for_consistency_request, ) diff --git a/tests/unit/admin_overlay/test_async_consistency.py b/tests/unit/admin_overlay/test_async_consistency.py index b64ae1a11..75dc894ff 100644 --- a/tests/unit/admin_overlay/test_async_consistency.py +++ b/tests/unit/admin_overlay/test_async_consistency.py @@ -20,8 +20,8 @@ except ImportError: # pragma: NO COVER import mock -from google.cloud.bigtable_admin_v2.overlay.types import async_consistency -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin.overlay.types import async_consistency +from google.cloud.bigtable.admin.types import bigtable_table_admin import pytest diff --git a/tests/unit/admin_overlay/test_async_restore_table.py b/tests/unit/admin_overlay/test_async_restore_table.py index 95799fc14..255b06b77 100644 --- a/tests/unit/admin_overlay/test_async_restore_table.py +++ b/tests/unit/admin_overlay/test_async_restore_table.py @@ -25,8 +25,8 @@ from google.api_core import operation_async, exceptions from google.api_core.future import async_future from google.api_core.operations_v1 import operations_async_client -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin, table -from google.cloud.bigtable_admin_v2.overlay.types import async_restore_table +from google.cloud.bigtable.admin.types import bigtable_table_admin, table +from google.cloud.bigtable.admin.overlay.types import async_restore_table import pytest diff --git a/tests/unit/admin_overlay/test_client.py b/tests/unit/admin_overlay/test_client.py index 07922b349..b4e20f27d 100644 --- a/tests/unit/admin_overlay/test_client.py +++ b/tests/unit/admin_overlay/test_client.py @@ -23,13 +23,13 @@ from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth.credentials import AnonymousCredentials -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import transports -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.overlay.services.bigtable_table_admin.client import ( +from google.cloud.bigtable.admin.services.bigtable_table_admin import transports +from google.cloud.bigtable.admin.types import bigtable_table_admin +from google.cloud.bigtable.admin.overlay.services.bigtable_table_admin.client import ( BigtableTableAdminClient, DEFAULT_CLIENT_INFO, ) -from google.cloud.bigtable_admin_v2.overlay.types import ( +from google.cloud.bigtable.admin.overlay.types import ( restore_table, wait_for_consistency_request, ) diff --git a/tests/unit/admin_overlay/test_consistency.py b/tests/unit/admin_overlay/test_consistency.py index 29bc0c481..28ad65dbf 100644 --- a/tests/unit/admin_overlay/test_consistency.py +++ b/tests/unit/admin_overlay/test_consistency.py @@ -19,8 +19,8 @@ except ImportError: # pragma: NO COVER import mock -from google.cloud.bigtable_admin_v2.overlay.types import consistency -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin.overlay.types import consistency +from google.cloud.bigtable.admin.types import bigtable_table_admin import pytest diff --git a/tests/unit/admin_overlay/test_oneof_message.py b/tests/unit/admin_overlay/test_oneof_message.py index b9c521235..45470f566 100644 --- a/tests/unit/admin_overlay/test_oneof_message.py +++ b/tests/unit/admin_overlay/test_oneof_message.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from google.cloud.bigtable_admin_v2.types import GcRule +from google.cloud.bigtable.admin.types import GcRule from google.protobuf import duration_pb2 import my_oneof_message diff --git a/tests/unit/admin_overlay/test_restore_table.py b/tests/unit/admin_overlay/test_restore_table.py index 23c6609e4..61ae59d06 100644 --- a/tests/unit/admin_overlay/test_restore_table.py +++ b/tests/unit/admin_overlay/test_restore_table.py @@ -23,8 +23,8 @@ from google.api_core import operation, exceptions from google.api_core.operations_v1 import operations_client -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin, table -from google.cloud.bigtable_admin_v2.overlay.types import restore_table +from google.cloud.bigtable.admin.types import bigtable_table_admin, table +from google.cloud.bigtable.admin.overlay.types import restore_table import pytest diff --git a/tests/unit/gapic/bigtable_admin_v2/__init__.py b/tests/unit/gapic/admin/__init__.py similarity index 100% rename from tests/unit/gapic/bigtable_admin_v2/__init__.py rename to tests/unit/gapic/admin/__init__.py diff --git a/tests/unit/gapic/bigtable_admin_v2/test_bigtable_instance_admin.py b/tests/unit/gapic/admin/test_bigtable_instance_admin.py similarity index 99% rename from tests/unit/gapic/bigtable_admin_v2/test_bigtable_instance_admin.py rename to tests/unit/gapic/admin/test_bigtable_instance_admin.py index 166f27eb8..cec773401 100644 --- a/tests/unit/gapic/bigtable_admin_v2/test_bigtable_instance_admin.py +++ b/tests/unit/gapic/admin/test_bigtable_instance_admin.py @@ -57,18 +57,18 @@ from google.api_core import retry as retries from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( +from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminAsyncClient, ) -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( +from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import pagers -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import transports -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import common -from google.cloud.bigtable_admin_v2.types import instance -from google.cloud.bigtable_admin_v2.types import instance as gba_instance +from google.cloud.bigtable.admin.services.bigtable_instance_admin import pagers +from google.cloud.bigtable.admin.services.bigtable_instance_admin import transports +from google.cloud.bigtable.admin.types import bigtable_instance_admin +from google.cloud.bigtable.admin.types import common +from google.cloud.bigtable.admin.types import instance +from google.cloud.bigtable.admin.types import instance as gba_instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import options_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore @@ -1104,7 +1104,7 @@ def test_bigtable_instance_admin_client_client_options_credentials_file( def test_bigtable_instance_admin_client_client_options_from_dict(): with mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.transports.BigtableInstanceAdminGrpcTransport.__init__" + "google.cloud.bigtable.admin.services.bigtable_instance_admin.transports.BigtableInstanceAdminGrpcTransport.__init__" ) as grpc_transport: grpc_transport.return_value = None client = BigtableInstanceAdminClient( @@ -25485,7 +25485,7 @@ def test_bigtable_instance_admin_base_transport_error(): def test_bigtable_instance_admin_base_transport(): # Instantiate the base transport. with mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.transports.BigtableInstanceAdminTransport.__init__" + "google.cloud.bigtable.admin.services.bigtable_instance_admin.transports.BigtableInstanceAdminTransport.__init__" ) as Transport: Transport.return_value = None transport = transports.BigtableInstanceAdminTransport( @@ -25553,7 +25553,7 @@ def test_bigtable_instance_admin_base_transport_with_credentials_file(): with mock.patch.object( google.auth, "load_credentials_from_file", autospec=True ) as load_creds, mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.transports.BigtableInstanceAdminTransport._prep_wrapped_messages" + "google.cloud.bigtable.admin.services.bigtable_instance_admin.transports.BigtableInstanceAdminTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) @@ -25580,7 +25580,7 @@ def test_bigtable_instance_admin_base_transport_with_credentials_file(): def test_bigtable_instance_admin_base_transport_with_adc(): # Test the default credentials are used if credentials and credentials_file are None. with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.transports.BigtableInstanceAdminTransport._prep_wrapped_messages" + "google.cloud.bigtable.admin.services.bigtable_instance_admin.transports.BigtableInstanceAdminTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None adc.return_value = (ga_credentials.AnonymousCredentials(), None) diff --git a/tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py b/tests/unit/gapic/admin/test_bigtable_table_admin.py similarity index 99% rename from tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py rename to tests/unit/gapic/admin/test_bigtable_table_admin.py index 7cbe6f3b1..99c2ce8fa 100644 --- a/tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py +++ b/tests/unit/gapic/admin/test_bigtable_table_admin.py @@ -57,18 +57,18 @@ from google.api_core import retry as retries from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( +from google.cloud.bigtable.admin.services.bigtable_table_admin import ( BaseBigtableTableAdminAsyncClient, ) -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( +from google.cloud.bigtable.admin.services.bigtable_table_admin import ( BaseBigtableTableAdminClient, ) -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import pagers -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import transports -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table -from google.cloud.bigtable_admin_v2.types import types +from google.cloud.bigtable.admin.services.bigtable_table_admin import pagers +from google.cloud.bigtable.admin.services.bigtable_table_admin import transports +from google.cloud.bigtable.admin.types import bigtable_table_admin +from google.cloud.bigtable.admin.types import table +from google.cloud.bigtable.admin.types import table as gba_table +from google.cloud.bigtable.admin.types import types from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import options_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore @@ -1109,7 +1109,7 @@ def test_base_bigtable_table_admin_client_client_options_credentials_file( def test_base_bigtable_table_admin_client_client_options_from_dict(): with mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports.BigtableTableAdminGrpcTransport.__init__" + "google.cloud.bigtable.admin.services.bigtable_table_admin.transports.BigtableTableAdminGrpcTransport.__init__" ) as grpc_transport: grpc_transport.return_value = None client = BaseBigtableTableAdminClient( @@ -28577,7 +28577,7 @@ def test_bigtable_table_admin_base_transport_error(): def test_bigtable_table_admin_base_transport(): # Instantiate the base transport. with mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports.BigtableTableAdminTransport.__init__" + "google.cloud.bigtable.admin.services.bigtable_table_admin.transports.BigtableTableAdminTransport.__init__" ) as Transport: Transport.return_value = None transport = transports.BigtableTableAdminTransport( @@ -28649,7 +28649,7 @@ def test_bigtable_table_admin_base_transport_with_credentials_file(): with mock.patch.object( google.auth, "load_credentials_from_file", autospec=True ) as load_creds, mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports.BigtableTableAdminTransport._prep_wrapped_messages" + "google.cloud.bigtable.admin.services.bigtable_table_admin.transports.BigtableTableAdminTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) @@ -28675,7 +28675,7 @@ def test_bigtable_table_admin_base_transport_with_credentials_file(): def test_bigtable_table_admin_base_transport_with_adc(): # Test the default credentials are used if credentials and credentials_file are None. with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports.BigtableTableAdminTransport._prep_wrapped_messages" + "google.cloud.bigtable.admin.services.bigtable_table_admin.transports.BigtableTableAdminTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None adc.return_value = (ga_credentials.AnonymousCredentials(), None) diff --git a/tests/unit/v2_client/test_app_profile.py b/tests/unit/v2_client/test_app_profile.py index 660ee7899..f83025cff 100644 --- a/tests/unit/v2_client/test_app_profile.py +++ b/tests/unit/v2_client/test_app_profile.py @@ -165,7 +165,7 @@ def test_app_profile___ne__(): def test_app_profile_from_pb_success_w_routing_any(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile from google.cloud.bigtable.enums import RoutingPolicyType @@ -194,7 +194,7 @@ def test_app_profile_from_pb_success_w_routing_any(): def test_app_profile_from_pb_success_w_routing_any_multi_cluster_ids(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile from google.cloud.bigtable.enums import RoutingPolicyType @@ -225,7 +225,7 @@ def test_app_profile_from_pb_success_w_routing_any_multi_cluster_ids(): def test_app_profile_from_pb_success_w_routing_single(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile from google.cloud.bigtable.enums import RoutingPolicyType @@ -258,7 +258,7 @@ def test_app_profile_from_pb_success_w_routing_single(): def test_app_profile_from_pb_w_bad_app_profile_name(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile bad_app_profile_name = "BAD_NAME" @@ -270,7 +270,7 @@ def test_app_profile_from_pb_w_bad_app_profile_name(): def test_app_profile_from_pb_w_instance_id_mistmatch(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile ALT_INSTANCE_ID = "ALT_INSTANCE_ID" @@ -285,7 +285,7 @@ def test_app_profile_from_pb_w_instance_id_mistmatch(): def test_app_profile_from_pb_w_project_mistmatch(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile ALT_PROJECT = "ALT_PROJECT" @@ -300,10 +300,10 @@ def test_app_profile_from_pb_w_project_mistmatch(): def test_app_profile_reload_w_routing_any(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.enums import RoutingPolicyType api = mock.create_autospec(BigtableInstanceAdminClient) @@ -362,10 +362,10 @@ def test_app_profile_reload_w_routing_any(): def test_app_profile_exists(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.api_core import exceptions instance_api = mock.create_autospec(BigtableInstanceAdminClient) @@ -397,7 +397,7 @@ def test_app_profile_exists(): def test_app_profile_create_w_routing_any(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) from google.cloud.bigtable.app_profile import AppProfile @@ -458,7 +458,7 @@ def test_app_profile_create_w_routing_any(): def test_app_profile_create_w_routing_single(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) from google.cloud.bigtable.app_profile import AppProfile @@ -530,11 +530,11 @@ def test_app_profile_create_w_wrong_routing_policy(): def test_app_profile_update_w_routing_any(): from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import RoutingPolicyType - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) from google.protobuf import field_mask_pb2 @@ -605,11 +605,11 @@ def test_app_profile_update_w_routing_any(): def test_app_profile_update_w_routing_any_multi_cluster_ids(): from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import RoutingPolicyType - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) from google.protobuf import field_mask_pb2 @@ -681,11 +681,11 @@ def test_app_profile_update_w_routing_any_multi_cluster_ids(): def test_app_profile_update_w_routing_single(): from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import RoutingPolicyType - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) from google.protobuf import field_mask_pb2 @@ -752,7 +752,7 @@ def test_app_profile_update_w_wrong_routing_policy(): def test_app_profile_delete(): from google.protobuf import empty_pb2 - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) diff --git a/tests/unit/v2_client/test_backup.py b/tests/unit/v2_client/test_backup.py index cc9251a35..5c75188c6 100644 --- a/tests/unit/v2_client/test_backup.py +++ b/tests/unit/v2_client/test_backup.py @@ -42,9 +42,9 @@ def _make_timestamp(): def _make_table_admin_client(): - from google.cloud.bigtable_admin_v2 import BaseBigtableTableAdminClient + from google.cloud.bigtable.admin import BigtableTableAdminClient - return mock.create_autospec(BaseBigtableTableAdminClient, instance=True) + return mock.create_autospec(BigtableTableAdminClient, instance=True) def _make_backup(*args, **kwargs): @@ -101,7 +101,7 @@ def test_backup_constructor_explicit(): def test_backup_from_pb_w_project_mismatch(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table from google.cloud.bigtable.backup import Backup alt_project_id = "alt-project-id" @@ -114,7 +114,7 @@ def test_backup_from_pb_w_project_mismatch(): def test_backup_from_pb_w_instance_mismatch(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table from google.cloud.bigtable.backup import Backup alt_instance = "/projects/%s/instances/alt-instance" % PROJECT_ID @@ -127,7 +127,7 @@ def test_backup_from_pb_w_instance_mismatch(): def test_backup_from_pb_w_bad_name(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table from google.cloud.bigtable.backup import Backup client = _Client() @@ -141,7 +141,7 @@ def test_backup_from_pb_w_bad_name(): def test_backup_from_pb_success(): from google.cloud.bigtable.encryption_info import EncryptionInfo from google.cloud.bigtable.error import Status - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table from google.cloud.bigtable.backup import Backup from google.cloud._helpers import _datetime_to_pb_timestamp from google.rpc.code_pb2 import Code @@ -191,7 +191,7 @@ def test_backup_from_pb_success(): def test_backup_name(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) @@ -226,7 +226,7 @@ def test_backup_parent_none(): def test_backup_parent_w_cluster(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) @@ -243,7 +243,7 @@ def test_backup_parent_w_cluster(): def test_backup_source_table_none(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) @@ -259,7 +259,7 @@ def test_backup_source_table_none(): def test_backup_source_table_valid(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) @@ -310,7 +310,7 @@ def test_backup_size(): def test_backup_state(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table instance = _Instance(INSTANCE_NAME) backup = _make_backup(BACKUP_ID, instance) @@ -349,7 +349,7 @@ def test_backup_create_w_grpc_error(): from google.api_core.exceptions import GoogleAPICallError from google.api_core.exceptions import Unknown from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table client = _Client() api = client.table_admin_client = _make_table_admin_client() @@ -378,7 +378,7 @@ def test_backup_create_w_grpc_error(): def test_backup_create_w_already_exists(): from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table from google.cloud.exceptions import Conflict client = _Client() @@ -408,7 +408,7 @@ def test_backup_create_w_already_exists(): def test_backup_create_w_instance_not_found(): from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table from google.cloud.exceptions import NotFound client = _Client() @@ -472,7 +472,7 @@ def test_backup_create_w_expire_time_not_set(): def test_backup_create_success(): from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table from google.cloud.bigtable import Client op_future = object() @@ -504,7 +504,7 @@ def test_backup_create_success(): def test_backup_get(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table from google.cloud._helpers import _datetime_to_pb_timestamp timestamp = _datetime_to_pb_timestamp(_make_timestamp()) @@ -530,7 +530,7 @@ def test_backup_get(): def test_backup_reload(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table from google.cloud._helpers import _datetime_to_pb_timestamp timestamp = _datetime_to_pb_timestamp(_make_timestamp()) @@ -594,7 +594,7 @@ def test_backup_exists_w_not_found(): def test_backup_exists_success(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table client = _Client() backup_pb = table.Backup(name=BACKUP_NAME) @@ -656,7 +656,7 @@ def test_backup_delete_success(): def test_backup_update_expire_time_w_grpc_error(): from google.api_core.exceptions import Unknown from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table from google.protobuf import field_mask_pb2 client = _Client() @@ -682,7 +682,7 @@ def test_backup_update_expire_time_w_grpc_error(): def test_backup_update_expire_time_w_not_found(): from google.api_core.exceptions import NotFound from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table from google.protobuf import field_mask_pb2 client = _Client() @@ -707,7 +707,7 @@ def test_backup_update_expire_time_w_not_found(): def test_backup_update_expire_time_success(): from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin.types import table from google.protobuf import field_mask_pb2 client = _Client() @@ -807,8 +807,8 @@ def test_backup_restore_to_another_instance(): def test_backup_get_iam_policy(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BaseBigtableTableAdminClient, + from google.cloud.bigtable.admin.overlay.services.bigtable_table_admin import ( + BigtableTableAdminClient, ) from google.iam.v1 import policy_pb2 from google.cloud.bigtable.policy import BIGTABLE_ADMIN_ROLE @@ -825,7 +825,7 @@ def test_backup_get_iam_policy(): bindings = [{"role": BIGTABLE_ADMIN_ROLE, "members": members}] iam_policy = policy_pb2.Policy(version=version, etag=etag, bindings=bindings) - table_api = mock.create_autospec(BaseBigtableTableAdminClient) + table_api = mock.create_autospec(BigtableTableAdminClient) client._table_admin_client = table_api table_api.get_iam_policy.return_value = iam_policy @@ -843,8 +843,8 @@ def test_backup_get_iam_policy(): def test_backup_set_iam_policy(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BaseBigtableTableAdminClient, + from google.cloud.bigtable.admin.overlay.services.bigtable_table_admin import ( + BigtableTableAdminClient, ) from google.iam.v1 import policy_pb2 from google.cloud.bigtable.policy import Policy @@ -862,7 +862,7 @@ def test_backup_set_iam_policy(): bindings = [{"role": BIGTABLE_ADMIN_ROLE, "members": sorted(members)}] iam_policy_pb = policy_pb2.Policy(version=version, etag=etag, bindings=bindings) - table_api = mock.create_autospec(BaseBigtableTableAdminClient) + table_api = mock.create_autospec(BigtableTableAdminClient) client._table_admin_client = table_api table_api.set_iam_policy.return_value = iam_policy_pb @@ -888,8 +888,8 @@ def test_backup_set_iam_policy(): def test_backup_test_iam_permissions(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BaseBigtableTableAdminClient, + from google.cloud.bigtable.admin.overlay.services.bigtable_table_admin import ( + BigtableTableAdminClient, ) from google.iam.v1 import iam_policy_pb2 @@ -903,7 +903,7 @@ def test_backup_test_iam_permissions(): response = iam_policy_pb2.TestIamPermissionsResponse(permissions=permissions) - table_api = mock.create_autospec(BaseBigtableTableAdminClient) + table_api = mock.create_autospec(BigtableTableAdminClient) table_api.test_iam_permissions.return_value = response client._table_admin_client = table_api diff --git a/tests/unit/v2_client/test_client.py b/tests/unit/v2_client/test_client.py index a4fc0f9cb..45d260267 100644 --- a/tests/unit/v2_client/test_client.py +++ b/tests/unit/v2_client/test_client.py @@ -449,18 +449,18 @@ def test_client_table_admin_client_not_initialized_no_admin_flag(): def test_client_table_admin_client_not_initialized_w_admin_flag(): - from google.cloud.bigtable_admin_v2 import BaseBigtableTableAdminClient + from google.cloud.bigtable.admin import BigtableTableAdminClient credentials = _make_credentials() client = _make_client(project=PROJECT, credentials=credentials, admin=True) table_admin_client = client.table_admin_client - assert isinstance(table_admin_client, BaseBigtableTableAdminClient) + assert isinstance(table_admin_client, BigtableTableAdminClient) assert client._table_admin_client is table_admin_client def test_client_table_admin_client_not_initialized_w_client_info(): - from google.cloud.bigtable_admin_v2 import BaseBigtableTableAdminClient + from google.cloud.bigtable.admin import BigtableTableAdminClient credentials = _make_credentials() client_info = mock.Mock() @@ -472,7 +472,7 @@ def test_client_table_admin_client_not_initialized_w_client_info(): ) table_admin_client = client.table_admin_client - assert isinstance(table_admin_client, BaseBigtableTableAdminClient) + assert isinstance(table_admin_client, BigtableTableAdminClient) assert client._client_info is client_info assert client._table_admin_client is table_admin_client @@ -488,7 +488,7 @@ def test_client_table_admin_client_not_initialized_w_client_options(): ) client._create_gapic_client_channel = mock.Mock() - patch = mock.patch("google.cloud.bigtable_admin_v2.BaseBigtableTableAdminClient") + patch = mock.patch("google.cloud.bigtable.admin.BigtableTableAdminClient") with patch as mocked: table_admin_client = client.table_admin_client @@ -519,7 +519,7 @@ def test_client_instance_admin_client_not_initialized_no_admin_flag(): def test_client_instance_admin_client_not_initialized_w_admin_flag(): - from google.cloud.bigtable_admin_v2 import BigtableInstanceAdminClient + from google.cloud.bigtable.admin import BigtableInstanceAdminClient credentials = _make_credentials() client = _make_client(project=PROJECT, credentials=credentials, admin=True) @@ -530,7 +530,7 @@ def test_client_instance_admin_client_not_initialized_w_admin_flag(): def test_client_instance_admin_client_not_initialized_w_client_info(): - from google.cloud.bigtable_admin_v2 import BigtableInstanceAdminClient + from google.cloud.bigtable.admin import BigtableInstanceAdminClient credentials = _make_credentials() client_info = mock.Mock() @@ -558,7 +558,7 @@ def test_client_instance_admin_client_not_initialized_w_client_options(): ) client._create_gapic_client_channel = mock.Mock() - patch = mock.patch("google.cloud.bigtable_admin_v2.BigtableInstanceAdminClient") + patch = mock.patch("google.cloud.bigtable.admin.BigtableInstanceAdminClient") with patch as mocked: instance_admin_client = client.instance_admin_client @@ -621,11 +621,11 @@ def test_client_instance_factory_non_defaults(): def test_client_list_instances(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) from google.cloud.bigtable.instance import Instance @@ -673,13 +673,13 @@ def test_client_list_instances(): def test_client_list_clusters(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.instance import Cluster instance_api = mock.create_autospec(BigtableInstanceAdminClient) diff --git a/tests/unit/v2_client/test_cluster.py b/tests/unit/v2_client/test_cluster.py index 65ed47437..277b64014 100644 --- a/tests/unit/v2_client/test_cluster.py +++ b/tests/unit/v2_client/test_cluster.py @@ -125,7 +125,7 @@ def test_cluster_kms_key_name_setter(): def test_cluster_from_pb_success(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.cluster import Cluster from google.cloud.bigtable import enums @@ -161,7 +161,7 @@ def test_cluster_from_pb_success(): def test_cluster_from_pb_w_bad_cluster_name(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.cluster import Cluster bad_cluster_name = "BAD_NAME" @@ -173,7 +173,7 @@ def test_cluster_from_pb_w_bad_cluster_name(): def test_cluster_from_pb_w_instance_id_mistmatch(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.cluster import Cluster ALT_INSTANCE_ID = "ALT_INSTANCE_ID" @@ -188,7 +188,7 @@ def test_cluster_from_pb_w_instance_id_mistmatch(): def test_cluster_from_pb_w_project_mistmatch(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.cluster import Cluster ALT_PROJECT = "ALT_PROJECT" @@ -203,7 +203,7 @@ def test_cluster_from_pb_w_project_mistmatch(): def test_cluster_from_pb_w_autoscaling(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.cluster import Cluster from google.cloud.bigtable import enums @@ -283,7 +283,7 @@ def test_cluster___ne__(): def _make_instance_admin_client(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) @@ -291,7 +291,7 @@ def _make_instance_admin_client(): def test_cluster_reload(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.enums import StorageType from google.cloud.bigtable.enums import Cluster @@ -348,7 +348,7 @@ def test_cluster_reload(): def test_cluster_exists_hit(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.instance import Instance credentials = _make_credentials() @@ -412,12 +412,12 @@ def test_cluster_create(): import datetime from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud._helpers import _datetime_to_pb_timestamp from google.cloud.bigtable.instance import Instance - from google.cloud.bigtable_admin_v2.types import instance as instance_v2_pb2 + from google.cloud.bigtable.admin.types import instance as instance_v2_pb2 from google.cloud.bigtable.enums import StorageType NOW = datetime.datetime.utcnow() @@ -467,12 +467,12 @@ def test_cluster_create_w_cmek(): import datetime from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud._helpers import _datetime_to_pb_timestamp from google.cloud.bigtable.instance import Instance - from google.cloud.bigtable_admin_v2.types import instance as instance_v2_pb2 + from google.cloud.bigtable.admin.types import instance as instance_v2_pb2 from google.cloud.bigtable.enums import StorageType NOW = datetime.datetime.utcnow() @@ -527,12 +527,12 @@ def test_cluster_create_w_autoscaling(): import datetime from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud._helpers import _datetime_to_pb_timestamp from google.cloud.bigtable.instance import Instance - from google.cloud.bigtable_admin_v2.types import instance as instance_v2_pb2 + from google.cloud.bigtable.admin.types import instance as instance_v2_pb2 from google.cloud.bigtable.enums import StorageType NOW = datetime.datetime.utcnow() @@ -597,7 +597,7 @@ def test_cluster_update(): from google.protobuf import field_mask_pb2 from google.protobuf.any_pb2 import Any from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import StorageType @@ -664,7 +664,7 @@ def test_cluster_update_w_autoscaling(): from google.protobuf import field_mask_pb2 from google.protobuf.any_pb2 import Any from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import StorageType @@ -723,7 +723,7 @@ def test_cluster_update_w_partial_autoscaling_config(): from google.protobuf import field_mask_pb2 from google.protobuf.any_pb2 import Any from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import StorageType @@ -807,7 +807,7 @@ def test_cluster_update_w_both_manual_and_autoscaling(): from google.protobuf import field_mask_pb2 from google.protobuf.any_pb2 import Any from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import StorageType @@ -866,7 +866,7 @@ def test_cluster_disable_autoscaling(): from google.longrunning import operations_pb2 from google.protobuf import field_mask_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud._helpers import _datetime_to_pb_timestamp diff --git a/tests/unit/v2_client/test_column_family.py b/tests/unit/v2_client/test_column_family.py index 2480e11cb..c55b41030 100644 --- a/tests/unit/v2_client/test_column_family.py +++ b/tests/unit/v2_client/test_column_family.py @@ -333,12 +333,12 @@ def test_column_family_to_pb_with_rule(): def _create_test_helper(gc_rule=None): - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_table_admin as table_admin_v2_pb2, ) from ._testing import _FakeStub - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BaseBigtableTableAdminClient, + from google.cloud.bigtable.admin.overlay.services.bigtable_table_admin import ( + BigtableTableAdminClient, ) project_id = "project-id" @@ -357,7 +357,7 @@ def _create_test_helper(gc_rule=None): + table_id ) - api = mock.create_autospec(BaseBigtableTableAdminClient) + api = mock.create_autospec(BigtableTableAdminClient) credentials = _make_credentials() client = _make_client(project=project_id, credentials=credentials, admin=True) @@ -405,11 +405,11 @@ def test_column_family_create_with_gc_rule(): def _update_test_helper(gc_rule=None): from ._testing import _FakeStub - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_table_admin as table_admin_v2_pb2, ) - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BaseBigtableTableAdminClient, + from google.cloud.bigtable.admin.overlay.services.bigtable_table_admin import ( + BigtableTableAdminClient, ) project_id = "project-id" @@ -428,7 +428,7 @@ def _update_test_helper(gc_rule=None): + table_id ) - api = mock.create_autospec(BaseBigtableTableAdminClient) + api = mock.create_autospec(BigtableTableAdminClient) credentials = _make_credentials() client = _make_client(project=project_id, credentials=credentials, admin=True) table = _Table(table_name, client=client) @@ -475,12 +475,12 @@ def test_column_family_update_with_gc_rule(): def test_column_family_delete(): from google.protobuf import empty_pb2 - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_table_admin as table_admin_v2_pb2, ) from ._testing import _FakeStub - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BaseBigtableTableAdminClient, + from google.cloud.bigtable.admin.overlay.services.bigtable_table_admin import ( + BigtableTableAdminClient, ) project_id = "project-id" @@ -499,7 +499,7 @@ def test_column_family_delete(): + table_id ) - api = mock.create_autospec(BaseBigtableTableAdminClient) + api = mock.create_autospec(BigtableTableAdminClient) credentials = _make_credentials() client = _make_client(project=project_id, credentials=credentials, admin=True) table = _Table(table_name, client=client) @@ -615,25 +615,25 @@ def WhichOneof(cls, name): def _GcRulePB(*args, **kw): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin.types import table as table_v2_pb2 return table_v2_pb2.GcRule(*args, **kw) def _GcRuleIntersectionPB(*args, **kw): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin.types import table as table_v2_pb2 return table_v2_pb2.GcRule.Intersection(*args, **kw) def _GcRuleUnionPB(*args, **kw): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin.types import table as table_v2_pb2 return table_v2_pb2.GcRule.Union(*args, **kw) def _ColumnFamilyPB(*args, **kw): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin.types import table as table_v2_pb2 return table_v2_pb2.ColumnFamily(*args, **kw) diff --git a/tests/unit/v2_client/test_instance.py b/tests/unit/v2_client/test_instance.py index 712fab1f5..c06036438 100644 --- a/tests/unit/v2_client/test_instance.py +++ b/tests/unit/v2_client/test_instance.py @@ -54,7 +54,7 @@ def _make_client(*args, **kwargs): def _make_instance_admin_api(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) @@ -103,7 +103,7 @@ def test_instance_constructor_non_default(): def test_instance__update_from_pb_success(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable import enums instance_type = data_v2_pb2.Instance.Type.PRODUCTION @@ -128,7 +128,7 @@ def test_instance__update_from_pb_success(): def test_instance__update_from_pb_success_defaults(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable import enums instance_pb = data_v2_pb2.Instance(display_name=DISPLAY_NAME) @@ -144,7 +144,7 @@ def test_instance__update_from_pb_success_defaults(): def test_instance__update_from_pb_wo_display_name(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 instance_pb = data_v2_pb2.Instance() instance = _make_instance(None, None) @@ -155,7 +155,7 @@ def test_instance__update_from_pb_wo_display_name(): def test_instance_from_pb_success(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable import enums from google.cloud.bigtable.instance import Instance @@ -183,7 +183,7 @@ def test_instance_from_pb_success(): def test_instance_from_pb_bad_instance_name(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.instance import Instance instance_name = "INCORRECT_FORMAT" @@ -194,7 +194,7 @@ def test_instance_from_pb_bad_instance_name(): def test_instance_from_pb_project_mistmatch(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.instance import Instance ALT_PROJECT = "ALT_PROJECT" @@ -272,10 +272,10 @@ def _instance_api_response_for_create(): from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) - from google.cloud.bigtable_admin_v2.types import instance + from google.cloud.bigtable.admin.types import instance NOW = datetime.datetime.utcnow() NOW_PB = _datetime_to_pb_timestamp(NOW) @@ -305,8 +305,8 @@ def _instance_api_response_for_create(): def test_instance_create(): from google.cloud.bigtable import enums - from google.cloud.bigtable_admin_v2.types import Instance - from google.cloud.bigtable_admin_v2.types import Cluster + from google.cloud.bigtable.admin.types import Instance + from google.cloud.bigtable.admin.types import Cluster import warnings credentials = _make_credentials() @@ -355,8 +355,8 @@ def test_instance_create(): def test_instance_create_w_clusters(): from google.cloud.bigtable import enums from google.cloud.bigtable.cluster import Cluster - from google.cloud.bigtable_admin_v2.types import Cluster as cluster_pb - from google.cloud.bigtable_admin_v2.types import Instance as instance_pb + from google.cloud.bigtable.admin.types import Cluster as cluster_pb + from google.cloud.bigtable.admin.types import Instance as instance_pb credentials = _make_credentials() client = _make_client(project=PROJECT, credentials=credentials, admin=True) @@ -421,7 +421,7 @@ def test_instance_create_w_clusters(): def test_instance_exists_hit(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 credentials = _make_credentials() client = _make_client(project=PROJECT, credentials=credentials, admin=True) @@ -472,7 +472,7 @@ def test_instance_exists_w_error(): def test_instance_reload(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable import enums DISPLAY_NAME = "hey-hi-hello" @@ -498,10 +498,10 @@ def _instance_api_response_for_update(): from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) - from google.cloud.bigtable_admin_v2.types import instance + from google.cloud.bigtable.admin.types import instance NOW = datetime.datetime.utcnow() NOW_PB = _datetime_to_pb_timestamp(NOW) @@ -529,7 +529,7 @@ def _instance_api_response_for_update(): def test_instance_update(): from google.cloud.bigtable import enums from google.protobuf import field_mask_pb2 - from google.cloud.bigtable_admin_v2.types import Instance + from google.cloud.bigtable.admin.types import Instance credentials = _make_credentials() client = _make_client(project=PROJECT, credentials=credentials, admin=True) @@ -562,7 +562,7 @@ def test_instance_update(): def test_instance_update_empty(): from google.protobuf import field_mask_pb2 - from google.cloud.bigtable_admin_v2.types import Instance + from google.cloud.bigtable.admin.types import Instance credentials = _make_credentials() client = _make_client(project=PROJECT, credentials=credentials, admin=True) @@ -745,10 +745,10 @@ def test_instance_cluster_factory(): def test_instance_list_clusters(): - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( bigtable_instance_admin as messages_v2_pb2, ) - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.instance import Instance from google.cloud.bigtable.instance import Cluster @@ -801,12 +801,12 @@ def test_instance_table_factory(): def _list_tables_helper(table_name=None): - from google.cloud.bigtable_admin_v2.types import table as table_data_v2_pb2 - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import table as table_data_v2_pb2 + from google.cloud.bigtable.admin.types import ( bigtable_table_admin as table_messages_v1_pb2, ) - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BaseBigtableTableAdminClient, + from google.cloud.bigtable.admin.overlay.services.bigtable_table_admin import ( + BigtableTableAdminClient, ) credentials = _make_credentials() @@ -816,7 +816,7 @@ def _list_tables_helper(table_name=None): instance_api = client._instance_admin_client = _make_instance_admin_api() instance_api.instance_path.return_value = "projects/project/instances/instance-id" table_api = client._table_admin_client = mock.create_autospec( - BaseBigtableTableAdminClient + BigtableTableAdminClient ) if table_name is None: table_name = TABLE_NAME @@ -889,7 +889,7 @@ def test_instance_app_profile_factory(): def test_instance_list_app_profiles(): from google.api_core.page_iterator import Iterator from google.api_core.page_iterator import Page - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile class _Iterator(Iterator): diff --git a/tests/unit/v2_client/test_table.py b/tests/unit/v2_client/test_table.py index 1d183e2fb..921f3aea8 100644 --- a/tests/unit/v2_client/test_table.py +++ b/tests/unit/v2_client/test_table.py @@ -345,16 +345,16 @@ def test_table___ne__(): def _make_table_api(): - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( + from google.cloud.bigtable.admin.overlay.services.bigtable_table_admin import ( client as bigtable_table_admin, ) - return mock.create_autospec(bigtable_table_admin.BaseBigtableTableAdminClient) + return mock.create_autospec(bigtable_table_admin.BigtableTableAdminClient) def _create_table_helper(split_keys=[], column_families={}): - from google.cloud.bigtable_admin_v2.types import table as table_pb2 - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import table as table_pb2 + from google.cloud.bigtable.admin.types import ( bigtable_table_admin as table_admin_messages_v2_pb2, ) from google.cloud.bigtable.column_family import ColumnFamily @@ -402,8 +402,8 @@ def test_table_create_with_split_keys(): def test_table_exists_hit(): - from google.cloud.bigtable_admin_v2.types import ListTablesResponse - from google.cloud.bigtable_admin_v2.types import Table + from google.cloud.bigtable.admin.types import ListTablesResponse + from google.cloud.bigtable.admin.types import Table from google.cloud.bigtable import enums credentials = _make_credentials() @@ -1406,7 +1406,7 @@ def test_table_backup_factory_non_defaults(): def _table_list_backups_helper(cluster_id=None, filter_=None, **kwargs): - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin.types import ( Backup as backup_pb, bigtable_table_admin, ) @@ -2273,19 +2273,19 @@ def _ReadRowsResponseV2(chunks, last_scanned_row_key=b""): def _TablePB(*args, **kw): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin.types import table as table_v2_pb2 return table_v2_pb2.Table(*args, **kw) def _ColumnFamilyPB(*args, **kw): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin.types import table as table_v2_pb2 return table_v2_pb2.ColumnFamily(*args, **kw) def _ClusterStatePB(replication_state): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin.types import table as table_v2_pb2 return table_v2_pb2.Table.ClusterState(replication_state=replication_state) @@ -2293,7 +2293,7 @@ def _ClusterStatePB(replication_state): def _ClusterStateEncryptionInfoPB( encryption_type, encryption_status=None, kms_key_version=None ): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin.types import table as table_v2_pb2 return table_v2_pb2.Table.ClusterState( encryption_info=(