google-cloud-bigtable 2.30.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- google/cloud/bigtable/__init__.py +25 -0
- google/cloud/bigtable/app_profile.py +377 -0
- google/cloud/bigtable/backup.py +490 -0
- google/cloud/bigtable/batcher.py +414 -0
- google/cloud/bigtable/client.py +475 -0
- google/cloud/bigtable/cluster.py +541 -0
- google/cloud/bigtable/column_family.py +362 -0
- google/cloud/bigtable/data/__init__.py +103 -0
- google/cloud/bigtable/data/_async/__init__.py +25 -0
- google/cloud/bigtable/data/_async/_mutate_rows.py +226 -0
- google/cloud/bigtable/data/_async/_read_rows.py +363 -0
- google/cloud/bigtable/data/_async/client.py +1522 -0
- google/cloud/bigtable/data/_async/mutations_batcher.py +534 -0
- google/cloud/bigtable/data/_cross_sync/__init__.py +20 -0
- google/cloud/bigtable/data/_cross_sync/_decorators.py +441 -0
- google/cloud/bigtable/data/_cross_sync/_mapping_meta.py +64 -0
- google/cloud/bigtable/data/_cross_sync/cross_sync.py +334 -0
- google/cloud/bigtable/data/_helpers.py +249 -0
- google/cloud/bigtable/data/_sync_autogen/_mutate_rows.py +182 -0
- google/cloud/bigtable/data/_sync_autogen/_read_rows.py +304 -0
- google/cloud/bigtable/data/_sync_autogen/client.py +1293 -0
- google/cloud/bigtable/data/_sync_autogen/mutations_batcher.py +449 -0
- google/cloud/bigtable/data/exceptions.py +340 -0
- google/cloud/bigtable/data/execute_query/__init__.py +43 -0
- google/cloud/bigtable/data/execute_query/_async/__init__.py +13 -0
- google/cloud/bigtable/data/execute_query/_async/execute_query_iterator.py +291 -0
- google/cloud/bigtable/data/execute_query/_byte_cursor.py +123 -0
- google/cloud/bigtable/data/execute_query/_checksum.py +43 -0
- google/cloud/bigtable/data/execute_query/_parameters_formatting.py +155 -0
- google/cloud/bigtable/data/execute_query/_query_result_parsing_utils.py +134 -0
- google/cloud/bigtable/data/execute_query/_reader.py +122 -0
- google/cloud/bigtable/data/execute_query/_sync_autogen/execute_query_iterator.py +239 -0
- google/cloud/bigtable/data/execute_query/metadata.py +399 -0
- google/cloud/bigtable/data/execute_query/values.py +123 -0
- google/cloud/bigtable/data/mutations.py +380 -0
- google/cloud/bigtable/data/read_modify_write_rules.py +112 -0
- google/cloud/bigtable/data/read_rows_query.py +536 -0
- google/cloud/bigtable/data/row.py +535 -0
- google/cloud/bigtable/data/row_filters.py +968 -0
- google/cloud/bigtable/encryption_info.py +64 -0
- google/cloud/bigtable/enums.py +223 -0
- google/cloud/bigtable/error.py +64 -0
- google/cloud/bigtable/gapic_version.py +16 -0
- google/cloud/bigtable/helpers.py +31 -0
- google/cloud/bigtable/instance.py +789 -0
- google/cloud/bigtable/policy.py +255 -0
- google/cloud/bigtable/row.py +1267 -0
- google/cloud/bigtable/row_data.py +380 -0
- google/cloud/bigtable/row_filters.py +838 -0
- google/cloud/bigtable/row_merger.py +250 -0
- google/cloud/bigtable/row_set.py +213 -0
- google/cloud/bigtable/table.py +1409 -0
- google/cloud/bigtable_admin/__init__.py +410 -0
- google/cloud/bigtable_admin/gapic_version.py +16 -0
- google/cloud/bigtable_admin/py.typed +2 -0
- google/cloud/bigtable_admin_v2/__init__.py +250 -0
- google/cloud/bigtable_admin_v2/gapic_metadata.json +962 -0
- google/cloud/bigtable_admin_v2/gapic_version.py +16 -0
- google/cloud/bigtable_admin_v2/py.typed +2 -0
- google/cloud/bigtable_admin_v2/services/__init__.py +15 -0
- google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/__init__.py +22 -0
- google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py +3465 -0
- google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py +3944 -0
- google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/pagers.py +681 -0
- google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/__init__.py +40 -0
- google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/base.py +751 -0
- google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc.py +1249 -0
- google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py +1579 -0
- google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest.py +6820 -0
- google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest_base.py +1746 -0
- google/cloud/bigtable_admin_v2/services/bigtable_table_admin/__init__.py +22 -0
- google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py +3472 -0
- google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py +3949 -0
- google/cloud/bigtable_admin_v2/services/bigtable_table_admin/pagers.py +669 -0
- google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/__init__.py +40 -0
- google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py +708 -0
- google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc.py +1257 -0
- google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py +1549 -0
- google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest.py +6609 -0
- google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest_base.py +1714 -0
- google/cloud/bigtable_admin_v2/types/__init__.py +248 -0
- google/cloud/bigtable_admin_v2/types/bigtable_instance_admin.py +1364 -0
- google/cloud/bigtable_admin_v2/types/bigtable_table_admin.py +1715 -0
- google/cloud/bigtable_admin_v2/types/common.py +81 -0
- google/cloud/bigtable_admin_v2/types/instance.py +819 -0
- google/cloud/bigtable_admin_v2/types/table.py +1028 -0
- google/cloud/bigtable_admin_v2/types/types.py +776 -0
- google/cloud/bigtable_v2/__init__.py +136 -0
- google/cloud/bigtable_v2/gapic_metadata.json +193 -0
- google/cloud/bigtable_v2/gapic_version.py +16 -0
- google/cloud/bigtable_v2/py.typed +2 -0
- google/cloud/bigtable_v2/services/__init__.py +15 -0
- google/cloud/bigtable_v2/services/bigtable/__init__.py +22 -0
- google/cloud/bigtable_v2/services/bigtable/async_client.py +1741 -0
- google/cloud/bigtable_v2/services/bigtable/client.py +2194 -0
- google/cloud/bigtable_v2/services/bigtable/transports/__init__.py +38 -0
- google/cloud/bigtable_v2/services/bigtable/transports/base.py +343 -0
- google/cloud/bigtable_v2/services/bigtable/transports/grpc.py +660 -0
- google/cloud/bigtable_v2/services/bigtable/transports/grpc_asyncio.py +762 -0
- google/cloud/bigtable_v2/services/bigtable/transports/rest.py +2489 -0
- google/cloud/bigtable_v2/services/bigtable/transports/rest_base.py +711 -0
- google/cloud/bigtable_v2/types/__init__.py +138 -0
- google/cloud/bigtable_v2/types/bigtable.py +1531 -0
- google/cloud/bigtable_v2/types/data.py +1612 -0
- google/cloud/bigtable_v2/types/feature_flags.py +119 -0
- google/cloud/bigtable_v2/types/request_stats.py +171 -0
- google/cloud/bigtable_v2/types/response_params.py +64 -0
- google/cloud/bigtable_v2/types/types.py +579 -0
- google_cloud_bigtable-2.30.0.data/scripts/fixup_bigtable_admin_v2_keywords.py +233 -0
- google_cloud_bigtable-2.30.0.data/scripts/fixup_bigtable_v2_keywords.py +186 -0
- google_cloud_bigtable-2.30.0.dist-info/LICENSE +202 -0
- google_cloud_bigtable-2.30.0.dist-info/METADATA +154 -0
- google_cloud_bigtable-2.30.0.dist-info/RECORD +115 -0
- google_cloud_bigtable-2.30.0.dist-info/WHEEL +5 -0
- google_cloud_bigtable-2.30.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,3465 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright 2024 Google LLC
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
16
|
+
import logging as std_logging
|
|
17
|
+
from collections import OrderedDict
|
|
18
|
+
import re
|
|
19
|
+
from typing import (
|
|
20
|
+
Dict,
|
|
21
|
+
Callable,
|
|
22
|
+
Mapping,
|
|
23
|
+
MutableMapping,
|
|
24
|
+
MutableSequence,
|
|
25
|
+
Optional,
|
|
26
|
+
Sequence,
|
|
27
|
+
Tuple,
|
|
28
|
+
Type,
|
|
29
|
+
Union,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
from google.cloud.bigtable_admin_v2 import gapic_version as package_version
|
|
33
|
+
|
|
34
|
+
from google.api_core.client_options import ClientOptions
|
|
35
|
+
from google.api_core import exceptions as core_exceptions
|
|
36
|
+
from google.api_core import gapic_v1
|
|
37
|
+
from google.api_core import retry_async as retries
|
|
38
|
+
from google.auth import credentials as ga_credentials # type: ignore
|
|
39
|
+
from google.oauth2 import service_account # type: ignore
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
try:
|
|
43
|
+
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None]
|
|
44
|
+
except AttributeError: # pragma: NO COVER
|
|
45
|
+
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
|
|
46
|
+
|
|
47
|
+
from google.api_core import operation # type: ignore
|
|
48
|
+
from google.api_core import operation_async # type: ignore
|
|
49
|
+
from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import pagers
|
|
50
|
+
from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin
|
|
51
|
+
from google.cloud.bigtable_admin_v2.types import common
|
|
52
|
+
from google.cloud.bigtable_admin_v2.types import instance
|
|
53
|
+
from google.cloud.bigtable_admin_v2.types import instance as gba_instance
|
|
54
|
+
from google.iam.v1 import iam_policy_pb2 # type: ignore
|
|
55
|
+
from google.iam.v1 import policy_pb2 # type: ignore
|
|
56
|
+
from google.protobuf import field_mask_pb2 # type: ignore
|
|
57
|
+
from google.protobuf import timestamp_pb2 # type: ignore
|
|
58
|
+
from .transports.base import BigtableInstanceAdminTransport, DEFAULT_CLIENT_INFO
|
|
59
|
+
from .transports.grpc_asyncio import BigtableInstanceAdminGrpcAsyncIOTransport
|
|
60
|
+
from .client import BigtableInstanceAdminClient
|
|
61
|
+
|
|
62
|
+
try:
|
|
63
|
+
from google.api_core import client_logging # type: ignore
|
|
64
|
+
|
|
65
|
+
CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
|
|
66
|
+
except ImportError: # pragma: NO COVER
|
|
67
|
+
CLIENT_LOGGING_SUPPORTED = False
|
|
68
|
+
|
|
69
|
+
_LOGGER = std_logging.getLogger(__name__)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class BigtableInstanceAdminAsyncClient:
|
|
73
|
+
"""Service for creating, configuring, and deleting Cloud
|
|
74
|
+
Bigtable Instances and Clusters. Provides access to the Instance
|
|
75
|
+
and Cluster schemas only, not the tables' metadata or data
|
|
76
|
+
stored in those tables.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
_client: BigtableInstanceAdminClient
|
|
80
|
+
|
|
81
|
+
# Copy defaults from the synchronous client for use here.
|
|
82
|
+
# Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
|
|
83
|
+
DEFAULT_ENDPOINT = BigtableInstanceAdminClient.DEFAULT_ENDPOINT
|
|
84
|
+
DEFAULT_MTLS_ENDPOINT = BigtableInstanceAdminClient.DEFAULT_MTLS_ENDPOINT
|
|
85
|
+
_DEFAULT_ENDPOINT_TEMPLATE = BigtableInstanceAdminClient._DEFAULT_ENDPOINT_TEMPLATE
|
|
86
|
+
_DEFAULT_UNIVERSE = BigtableInstanceAdminClient._DEFAULT_UNIVERSE
|
|
87
|
+
|
|
88
|
+
app_profile_path = staticmethod(BigtableInstanceAdminClient.app_profile_path)
|
|
89
|
+
parse_app_profile_path = staticmethod(
|
|
90
|
+
BigtableInstanceAdminClient.parse_app_profile_path
|
|
91
|
+
)
|
|
92
|
+
cluster_path = staticmethod(BigtableInstanceAdminClient.cluster_path)
|
|
93
|
+
parse_cluster_path = staticmethod(BigtableInstanceAdminClient.parse_cluster_path)
|
|
94
|
+
crypto_key_path = staticmethod(BigtableInstanceAdminClient.crypto_key_path)
|
|
95
|
+
parse_crypto_key_path = staticmethod(
|
|
96
|
+
BigtableInstanceAdminClient.parse_crypto_key_path
|
|
97
|
+
)
|
|
98
|
+
hot_tablet_path = staticmethod(BigtableInstanceAdminClient.hot_tablet_path)
|
|
99
|
+
parse_hot_tablet_path = staticmethod(
|
|
100
|
+
BigtableInstanceAdminClient.parse_hot_tablet_path
|
|
101
|
+
)
|
|
102
|
+
instance_path = staticmethod(BigtableInstanceAdminClient.instance_path)
|
|
103
|
+
parse_instance_path = staticmethod(BigtableInstanceAdminClient.parse_instance_path)
|
|
104
|
+
logical_view_path = staticmethod(BigtableInstanceAdminClient.logical_view_path)
|
|
105
|
+
parse_logical_view_path = staticmethod(
|
|
106
|
+
BigtableInstanceAdminClient.parse_logical_view_path
|
|
107
|
+
)
|
|
108
|
+
materialized_view_path = staticmethod(
|
|
109
|
+
BigtableInstanceAdminClient.materialized_view_path
|
|
110
|
+
)
|
|
111
|
+
parse_materialized_view_path = staticmethod(
|
|
112
|
+
BigtableInstanceAdminClient.parse_materialized_view_path
|
|
113
|
+
)
|
|
114
|
+
table_path = staticmethod(BigtableInstanceAdminClient.table_path)
|
|
115
|
+
parse_table_path = staticmethod(BigtableInstanceAdminClient.parse_table_path)
|
|
116
|
+
common_billing_account_path = staticmethod(
|
|
117
|
+
BigtableInstanceAdminClient.common_billing_account_path
|
|
118
|
+
)
|
|
119
|
+
parse_common_billing_account_path = staticmethod(
|
|
120
|
+
BigtableInstanceAdminClient.parse_common_billing_account_path
|
|
121
|
+
)
|
|
122
|
+
common_folder_path = staticmethod(BigtableInstanceAdminClient.common_folder_path)
|
|
123
|
+
parse_common_folder_path = staticmethod(
|
|
124
|
+
BigtableInstanceAdminClient.parse_common_folder_path
|
|
125
|
+
)
|
|
126
|
+
common_organization_path = staticmethod(
|
|
127
|
+
BigtableInstanceAdminClient.common_organization_path
|
|
128
|
+
)
|
|
129
|
+
parse_common_organization_path = staticmethod(
|
|
130
|
+
BigtableInstanceAdminClient.parse_common_organization_path
|
|
131
|
+
)
|
|
132
|
+
common_project_path = staticmethod(BigtableInstanceAdminClient.common_project_path)
|
|
133
|
+
parse_common_project_path = staticmethod(
|
|
134
|
+
BigtableInstanceAdminClient.parse_common_project_path
|
|
135
|
+
)
|
|
136
|
+
common_location_path = staticmethod(
|
|
137
|
+
BigtableInstanceAdminClient.common_location_path
|
|
138
|
+
)
|
|
139
|
+
parse_common_location_path = staticmethod(
|
|
140
|
+
BigtableInstanceAdminClient.parse_common_location_path
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
@classmethod
|
|
144
|
+
def from_service_account_info(cls, info: dict, *args, **kwargs):
|
|
145
|
+
"""Creates an instance of this client using the provided credentials
|
|
146
|
+
info.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
info (dict): The service account private key info.
|
|
150
|
+
args: Additional arguments to pass to the constructor.
|
|
151
|
+
kwargs: Additional arguments to pass to the constructor.
|
|
152
|
+
|
|
153
|
+
Returns:
|
|
154
|
+
BigtableInstanceAdminAsyncClient: The constructed client.
|
|
155
|
+
"""
|
|
156
|
+
return BigtableInstanceAdminClient.from_service_account_info.__func__(BigtableInstanceAdminAsyncClient, info, *args, **kwargs) # type: ignore
|
|
157
|
+
|
|
158
|
+
@classmethod
|
|
159
|
+
def from_service_account_file(cls, filename: str, *args, **kwargs):
|
|
160
|
+
"""Creates an instance of this client using the provided credentials
|
|
161
|
+
file.
|
|
162
|
+
|
|
163
|
+
Args:
|
|
164
|
+
filename (str): The path to the service account private key json
|
|
165
|
+
file.
|
|
166
|
+
args: Additional arguments to pass to the constructor.
|
|
167
|
+
kwargs: Additional arguments to pass to the constructor.
|
|
168
|
+
|
|
169
|
+
Returns:
|
|
170
|
+
BigtableInstanceAdminAsyncClient: The constructed client.
|
|
171
|
+
"""
|
|
172
|
+
return BigtableInstanceAdminClient.from_service_account_file.__func__(BigtableInstanceAdminAsyncClient, filename, *args, **kwargs) # type: ignore
|
|
173
|
+
|
|
174
|
+
from_service_account_json = from_service_account_file
|
|
175
|
+
|
|
176
|
+
@classmethod
|
|
177
|
+
def get_mtls_endpoint_and_cert_source(
|
|
178
|
+
cls, client_options: Optional[ClientOptions] = None
|
|
179
|
+
):
|
|
180
|
+
"""Return the API endpoint and client cert source for mutual TLS.
|
|
181
|
+
|
|
182
|
+
The client cert source is determined in the following order:
|
|
183
|
+
(1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the
|
|
184
|
+
client cert source is None.
|
|
185
|
+
(2) if `client_options.client_cert_source` is provided, use the provided one; if the
|
|
186
|
+
default client cert source exists, use the default one; otherwise the client cert
|
|
187
|
+
source is None.
|
|
188
|
+
|
|
189
|
+
The API endpoint is determined in the following order:
|
|
190
|
+
(1) if `client_options.api_endpoint` if provided, use the provided one.
|
|
191
|
+
(2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the
|
|
192
|
+
default mTLS endpoint; if the environment variable is "never", use the default API
|
|
193
|
+
endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
|
|
194
|
+
use the default API endpoint.
|
|
195
|
+
|
|
196
|
+
More details can be found at https://google.aip.dev/auth/4114.
|
|
197
|
+
|
|
198
|
+
Args:
|
|
199
|
+
client_options (google.api_core.client_options.ClientOptions): Custom options for the
|
|
200
|
+
client. Only the `api_endpoint` and `client_cert_source` properties may be used
|
|
201
|
+
in this method.
|
|
202
|
+
|
|
203
|
+
Returns:
|
|
204
|
+
Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the
|
|
205
|
+
client cert source to use.
|
|
206
|
+
|
|
207
|
+
Raises:
|
|
208
|
+
google.auth.exceptions.MutualTLSChannelError: If any errors happen.
|
|
209
|
+
"""
|
|
210
|
+
return BigtableInstanceAdminClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore
|
|
211
|
+
|
|
212
|
+
@property
|
|
213
|
+
def transport(self) -> BigtableInstanceAdminTransport:
|
|
214
|
+
"""Returns the transport used by the client instance.
|
|
215
|
+
|
|
216
|
+
Returns:
|
|
217
|
+
BigtableInstanceAdminTransport: The transport used by the client instance.
|
|
218
|
+
"""
|
|
219
|
+
return self._client.transport
|
|
220
|
+
|
|
221
|
+
@property
|
|
222
|
+
def api_endpoint(self):
|
|
223
|
+
"""Return the API endpoint used by the client instance.
|
|
224
|
+
|
|
225
|
+
Returns:
|
|
226
|
+
str: The API endpoint used by the client instance.
|
|
227
|
+
"""
|
|
228
|
+
return self._client._api_endpoint
|
|
229
|
+
|
|
230
|
+
@property
|
|
231
|
+
def universe_domain(self) -> str:
|
|
232
|
+
"""Return the universe domain used by the client instance.
|
|
233
|
+
|
|
234
|
+
Returns:
|
|
235
|
+
str: The universe domain used
|
|
236
|
+
by the client instance.
|
|
237
|
+
"""
|
|
238
|
+
return self._client._universe_domain
|
|
239
|
+
|
|
240
|
+
get_transport_class = BigtableInstanceAdminClient.get_transport_class
|
|
241
|
+
|
|
242
|
+
def __init__(
|
|
243
|
+
self,
|
|
244
|
+
*,
|
|
245
|
+
credentials: Optional[ga_credentials.Credentials] = None,
|
|
246
|
+
transport: Optional[
|
|
247
|
+
Union[
|
|
248
|
+
str,
|
|
249
|
+
BigtableInstanceAdminTransport,
|
|
250
|
+
Callable[..., BigtableInstanceAdminTransport],
|
|
251
|
+
]
|
|
252
|
+
] = "grpc_asyncio",
|
|
253
|
+
client_options: Optional[ClientOptions] = None,
|
|
254
|
+
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
|
|
255
|
+
) -> None:
|
|
256
|
+
"""Instantiates the bigtable instance admin async client.
|
|
257
|
+
|
|
258
|
+
Args:
|
|
259
|
+
credentials (Optional[google.auth.credentials.Credentials]): The
|
|
260
|
+
authorization credentials to attach to requests. These
|
|
261
|
+
credentials identify the application to the service; if none
|
|
262
|
+
are specified, the client will attempt to ascertain the
|
|
263
|
+
credentials from the environment.
|
|
264
|
+
transport (Optional[Union[str,BigtableInstanceAdminTransport,Callable[..., BigtableInstanceAdminTransport]]]):
|
|
265
|
+
The transport to use, or a Callable that constructs and returns a new transport to use.
|
|
266
|
+
If a Callable is given, it will be called with the same set of initialization
|
|
267
|
+
arguments as used in the BigtableInstanceAdminTransport constructor.
|
|
268
|
+
If set to None, a transport is chosen automatically.
|
|
269
|
+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
|
|
270
|
+
Custom options for the client.
|
|
271
|
+
|
|
272
|
+
1. The ``api_endpoint`` property can be used to override the
|
|
273
|
+
default endpoint provided by the client when ``transport`` is
|
|
274
|
+
not explicitly provided. Only if this property is not set and
|
|
275
|
+
``transport`` was not explicitly provided, the endpoint is
|
|
276
|
+
determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
|
|
277
|
+
variable, which have one of the following values:
|
|
278
|
+
"always" (always use the default mTLS endpoint), "never" (always
|
|
279
|
+
use the default regular endpoint) and "auto" (auto-switch to the
|
|
280
|
+
default mTLS endpoint if client certificate is present; this is
|
|
281
|
+
the default value).
|
|
282
|
+
|
|
283
|
+
2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
|
|
284
|
+
is "true", then the ``client_cert_source`` property can be used
|
|
285
|
+
to provide a client certificate for mTLS transport. If
|
|
286
|
+
not provided, the default SSL client certificate will be used if
|
|
287
|
+
present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
|
|
288
|
+
set, no client certificate will be used.
|
|
289
|
+
|
|
290
|
+
3. The ``universe_domain`` property can be used to override the
|
|
291
|
+
default "googleapis.com" universe. Note that ``api_endpoint``
|
|
292
|
+
property still takes precedence; and ``universe_domain`` is
|
|
293
|
+
currently not supported for mTLS.
|
|
294
|
+
|
|
295
|
+
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
|
|
296
|
+
The client info used to send a user-agent string along with
|
|
297
|
+
API requests. If ``None``, then default info will be used.
|
|
298
|
+
Generally, you only need to set this if you're developing
|
|
299
|
+
your own client library.
|
|
300
|
+
|
|
301
|
+
Raises:
|
|
302
|
+
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
|
|
303
|
+
creation failed for any reason.
|
|
304
|
+
"""
|
|
305
|
+
self._client = BigtableInstanceAdminClient(
|
|
306
|
+
credentials=credentials,
|
|
307
|
+
transport=transport,
|
|
308
|
+
client_options=client_options,
|
|
309
|
+
client_info=client_info,
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
313
|
+
std_logging.DEBUG
|
|
314
|
+
): # pragma: NO COVER
|
|
315
|
+
_LOGGER.debug(
|
|
316
|
+
"Created client `google.bigtable.admin_v2.BigtableInstanceAdminAsyncClient`.",
|
|
317
|
+
extra={
|
|
318
|
+
"serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin",
|
|
319
|
+
"universeDomain": getattr(
|
|
320
|
+
self._client._transport._credentials, "universe_domain", ""
|
|
321
|
+
),
|
|
322
|
+
"credentialsType": f"{type(self._client._transport._credentials).__module__}.{type(self._client._transport._credentials).__qualname__}",
|
|
323
|
+
"credentialsInfo": getattr(
|
|
324
|
+
self.transport._credentials, "get_cred_info", lambda: None
|
|
325
|
+
)(),
|
|
326
|
+
}
|
|
327
|
+
if hasattr(self._client._transport, "_credentials")
|
|
328
|
+
else {
|
|
329
|
+
"serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin",
|
|
330
|
+
"credentialsType": None,
|
|
331
|
+
},
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
async def create_instance(
|
|
335
|
+
self,
|
|
336
|
+
request: Optional[
|
|
337
|
+
Union[bigtable_instance_admin.CreateInstanceRequest, dict]
|
|
338
|
+
] = None,
|
|
339
|
+
*,
|
|
340
|
+
parent: Optional[str] = None,
|
|
341
|
+
instance_id: Optional[str] = None,
|
|
342
|
+
instance: Optional[gba_instance.Instance] = None,
|
|
343
|
+
clusters: Optional[MutableMapping[str, gba_instance.Cluster]] = None,
|
|
344
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
345
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
346
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
347
|
+
) -> operation_async.AsyncOperation:
|
|
348
|
+
r"""Create an instance within a project.
|
|
349
|
+
|
|
350
|
+
Note that exactly one of Cluster.serve_nodes and
|
|
351
|
+
Cluster.cluster_config.cluster_autoscaling_config can be set. If
|
|
352
|
+
serve_nodes is set to non-zero, then the cluster is manually
|
|
353
|
+
scaled. If cluster_config.cluster_autoscaling_config is
|
|
354
|
+
non-empty, then autoscaling is enabled.
|
|
355
|
+
|
|
356
|
+
Args:
|
|
357
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateInstanceRequest, dict]]):
|
|
358
|
+
The request object. Request message for
|
|
359
|
+
BigtableInstanceAdmin.CreateInstance.
|
|
360
|
+
parent (:class:`str`):
|
|
361
|
+
Required. The unique name of the project in which to
|
|
362
|
+
create the new instance. Values are of the form
|
|
363
|
+
``projects/{project}``.
|
|
364
|
+
|
|
365
|
+
This corresponds to the ``parent`` field
|
|
366
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
367
|
+
should not be set.
|
|
368
|
+
instance_id (:class:`str`):
|
|
369
|
+
Required. The ID to be used when referring to the new
|
|
370
|
+
instance within its project, e.g., just ``myinstance``
|
|
371
|
+
rather than ``projects/myproject/instances/myinstance``.
|
|
372
|
+
|
|
373
|
+
This corresponds to the ``instance_id`` field
|
|
374
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
375
|
+
should not be set.
|
|
376
|
+
instance (:class:`google.cloud.bigtable_admin_v2.types.Instance`):
|
|
377
|
+
Required. The instance to create. Fields marked
|
|
378
|
+
``OutputOnly`` must be left blank.
|
|
379
|
+
|
|
380
|
+
This corresponds to the ``instance`` field
|
|
381
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
382
|
+
should not be set.
|
|
383
|
+
clusters (:class:`MutableMapping[str, google.cloud.bigtable_admin_v2.types.Cluster]`):
|
|
384
|
+
Required. The clusters to be created within the
|
|
385
|
+
instance, mapped by desired cluster ID, e.g., just
|
|
386
|
+
``mycluster`` rather than
|
|
387
|
+
``projects/myproject/instances/myinstance/clusters/mycluster``.
|
|
388
|
+
Fields marked ``OutputOnly`` must be left blank.
|
|
389
|
+
|
|
390
|
+
This corresponds to the ``clusters`` field
|
|
391
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
392
|
+
should not be set.
|
|
393
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
394
|
+
should be retried.
|
|
395
|
+
timeout (float): The timeout for this request.
|
|
396
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
397
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
398
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
399
|
+
be of type `bytes`.
|
|
400
|
+
|
|
401
|
+
Returns:
|
|
402
|
+
google.api_core.operation_async.AsyncOperation:
|
|
403
|
+
An object representing a long-running operation.
|
|
404
|
+
|
|
405
|
+
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
|
|
406
|
+
the resources that serve them. All tables in an
|
|
407
|
+
instance are served from all
|
|
408
|
+
[Clusters][google.bigtable.admin.v2.Cluster] in the
|
|
409
|
+
instance.
|
|
410
|
+
|
|
411
|
+
"""
|
|
412
|
+
# Create or coerce a protobuf request object.
|
|
413
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
414
|
+
# gotten any keyword arguments that map to the request.
|
|
415
|
+
flattened_params = [parent, instance_id, instance, clusters]
|
|
416
|
+
has_flattened_params = (
|
|
417
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
418
|
+
)
|
|
419
|
+
if request is not None and has_flattened_params:
|
|
420
|
+
raise ValueError(
|
|
421
|
+
"If the `request` argument is set, then none of "
|
|
422
|
+
"the individual field arguments should be set."
|
|
423
|
+
)
|
|
424
|
+
|
|
425
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
426
|
+
# there are no flattened fields), or create one.
|
|
427
|
+
if not isinstance(request, bigtable_instance_admin.CreateInstanceRequest):
|
|
428
|
+
request = bigtable_instance_admin.CreateInstanceRequest(request)
|
|
429
|
+
|
|
430
|
+
# If we have keyword arguments corresponding to fields on the
|
|
431
|
+
# request, apply these.
|
|
432
|
+
if parent is not None:
|
|
433
|
+
request.parent = parent
|
|
434
|
+
if instance_id is not None:
|
|
435
|
+
request.instance_id = instance_id
|
|
436
|
+
if instance is not None:
|
|
437
|
+
request.instance = instance
|
|
438
|
+
|
|
439
|
+
if clusters:
|
|
440
|
+
request.clusters.update(clusters)
|
|
441
|
+
|
|
442
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
443
|
+
# and friendly error handling.
|
|
444
|
+
rpc = self._client._transport._wrapped_methods[
|
|
445
|
+
self._client._transport.create_instance
|
|
446
|
+
]
|
|
447
|
+
|
|
448
|
+
# Certain fields should be provided within the metadata header;
|
|
449
|
+
# add these here.
|
|
450
|
+
metadata = tuple(metadata) + (
|
|
451
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
# Validate the universe domain.
|
|
455
|
+
self._client._validate_universe_domain()
|
|
456
|
+
|
|
457
|
+
# Send the request.
|
|
458
|
+
response = await rpc(
|
|
459
|
+
request,
|
|
460
|
+
retry=retry,
|
|
461
|
+
timeout=timeout,
|
|
462
|
+
metadata=metadata,
|
|
463
|
+
)
|
|
464
|
+
|
|
465
|
+
# Wrap the response in an operation future.
|
|
466
|
+
response = operation_async.from_gapic(
|
|
467
|
+
response,
|
|
468
|
+
self._client._transport.operations_client,
|
|
469
|
+
gba_instance.Instance,
|
|
470
|
+
metadata_type=bigtable_instance_admin.CreateInstanceMetadata,
|
|
471
|
+
)
|
|
472
|
+
|
|
473
|
+
# Done; return the response.
|
|
474
|
+
return response
|
|
475
|
+
|
|
476
|
+
async def get_instance(
|
|
477
|
+
self,
|
|
478
|
+
request: Optional[
|
|
479
|
+
Union[bigtable_instance_admin.GetInstanceRequest, dict]
|
|
480
|
+
] = None,
|
|
481
|
+
*,
|
|
482
|
+
name: Optional[str] = None,
|
|
483
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
484
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
485
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
486
|
+
) -> instance.Instance:
|
|
487
|
+
r"""Gets information about an instance.
|
|
488
|
+
|
|
489
|
+
Args:
|
|
490
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetInstanceRequest, dict]]):
|
|
491
|
+
The request object. Request message for
|
|
492
|
+
BigtableInstanceAdmin.GetInstance.
|
|
493
|
+
name (:class:`str`):
|
|
494
|
+
Required. The unique name of the requested instance.
|
|
495
|
+
Values are of the form
|
|
496
|
+
``projects/{project}/instances/{instance}``.
|
|
497
|
+
|
|
498
|
+
This corresponds to the ``name`` field
|
|
499
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
500
|
+
should not be set.
|
|
501
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
502
|
+
should be retried.
|
|
503
|
+
timeout (float): The timeout for this request.
|
|
504
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
505
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
506
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
507
|
+
be of type `bytes`.
|
|
508
|
+
|
|
509
|
+
Returns:
|
|
510
|
+
google.cloud.bigtable_admin_v2.types.Instance:
|
|
511
|
+
A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and
|
|
512
|
+
the resources that serve them. All tables in an
|
|
513
|
+
instance are served from all
|
|
514
|
+
[Clusters][google.bigtable.admin.v2.Cluster] in the
|
|
515
|
+
instance.
|
|
516
|
+
|
|
517
|
+
"""
|
|
518
|
+
# Create or coerce a protobuf request object.
|
|
519
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
520
|
+
# gotten any keyword arguments that map to the request.
|
|
521
|
+
flattened_params = [name]
|
|
522
|
+
has_flattened_params = (
|
|
523
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
524
|
+
)
|
|
525
|
+
if request is not None and has_flattened_params:
|
|
526
|
+
raise ValueError(
|
|
527
|
+
"If the `request` argument is set, then none of "
|
|
528
|
+
"the individual field arguments should be set."
|
|
529
|
+
)
|
|
530
|
+
|
|
531
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
532
|
+
# there are no flattened fields), or create one.
|
|
533
|
+
if not isinstance(request, bigtable_instance_admin.GetInstanceRequest):
|
|
534
|
+
request = bigtable_instance_admin.GetInstanceRequest(request)
|
|
535
|
+
|
|
536
|
+
# If we have keyword arguments corresponding to fields on the
|
|
537
|
+
# request, apply these.
|
|
538
|
+
if name is not None:
|
|
539
|
+
request.name = name
|
|
540
|
+
|
|
541
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
542
|
+
# and friendly error handling.
|
|
543
|
+
rpc = self._client._transport._wrapped_methods[
|
|
544
|
+
self._client._transport.get_instance
|
|
545
|
+
]
|
|
546
|
+
|
|
547
|
+
# Certain fields should be provided within the metadata header;
|
|
548
|
+
# add these here.
|
|
549
|
+
metadata = tuple(metadata) + (
|
|
550
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
551
|
+
)
|
|
552
|
+
|
|
553
|
+
# Validate the universe domain.
|
|
554
|
+
self._client._validate_universe_domain()
|
|
555
|
+
|
|
556
|
+
# Send the request.
|
|
557
|
+
response = await rpc(
|
|
558
|
+
request,
|
|
559
|
+
retry=retry,
|
|
560
|
+
timeout=timeout,
|
|
561
|
+
metadata=metadata,
|
|
562
|
+
)
|
|
563
|
+
|
|
564
|
+
# Done; return the response.
|
|
565
|
+
return response
|
|
566
|
+
|
|
567
|
+
async def list_instances(
|
|
568
|
+
self,
|
|
569
|
+
request: Optional[
|
|
570
|
+
Union[bigtable_instance_admin.ListInstancesRequest, dict]
|
|
571
|
+
] = None,
|
|
572
|
+
*,
|
|
573
|
+
parent: Optional[str] = None,
|
|
574
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
575
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
576
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
577
|
+
) -> bigtable_instance_admin.ListInstancesResponse:
|
|
578
|
+
r"""Lists information about instances in a project.
|
|
579
|
+
|
|
580
|
+
Args:
|
|
581
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListInstancesRequest, dict]]):
|
|
582
|
+
The request object. Request message for
|
|
583
|
+
BigtableInstanceAdmin.ListInstances.
|
|
584
|
+
parent (:class:`str`):
|
|
585
|
+
Required. The unique name of the project for which a
|
|
586
|
+
list of instances is requested. Values are of the form
|
|
587
|
+
``projects/{project}``.
|
|
588
|
+
|
|
589
|
+
This corresponds to the ``parent`` field
|
|
590
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
591
|
+
should not be set.
|
|
592
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
593
|
+
should be retried.
|
|
594
|
+
timeout (float): The timeout for this request.
|
|
595
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
596
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
597
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
598
|
+
be of type `bytes`.
|
|
599
|
+
|
|
600
|
+
Returns:
|
|
601
|
+
google.cloud.bigtable_admin_v2.types.ListInstancesResponse:
|
|
602
|
+
Response message for
|
|
603
|
+
BigtableInstanceAdmin.ListInstances.
|
|
604
|
+
|
|
605
|
+
"""
|
|
606
|
+
# Create or coerce a protobuf request object.
|
|
607
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
608
|
+
# gotten any keyword arguments that map to the request.
|
|
609
|
+
flattened_params = [parent]
|
|
610
|
+
has_flattened_params = (
|
|
611
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
612
|
+
)
|
|
613
|
+
if request is not None and has_flattened_params:
|
|
614
|
+
raise ValueError(
|
|
615
|
+
"If the `request` argument is set, then none of "
|
|
616
|
+
"the individual field arguments should be set."
|
|
617
|
+
)
|
|
618
|
+
|
|
619
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
620
|
+
# there are no flattened fields), or create one.
|
|
621
|
+
if not isinstance(request, bigtable_instance_admin.ListInstancesRequest):
|
|
622
|
+
request = bigtable_instance_admin.ListInstancesRequest(request)
|
|
623
|
+
|
|
624
|
+
# If we have keyword arguments corresponding to fields on the
|
|
625
|
+
# request, apply these.
|
|
626
|
+
if parent is not None:
|
|
627
|
+
request.parent = parent
|
|
628
|
+
|
|
629
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
630
|
+
# and friendly error handling.
|
|
631
|
+
rpc = self._client._transport._wrapped_methods[
|
|
632
|
+
self._client._transport.list_instances
|
|
633
|
+
]
|
|
634
|
+
|
|
635
|
+
# Certain fields should be provided within the metadata header;
|
|
636
|
+
# add these here.
|
|
637
|
+
metadata = tuple(metadata) + (
|
|
638
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
639
|
+
)
|
|
640
|
+
|
|
641
|
+
# Validate the universe domain.
|
|
642
|
+
self._client._validate_universe_domain()
|
|
643
|
+
|
|
644
|
+
# Send the request.
|
|
645
|
+
response = await rpc(
|
|
646
|
+
request,
|
|
647
|
+
retry=retry,
|
|
648
|
+
timeout=timeout,
|
|
649
|
+
metadata=metadata,
|
|
650
|
+
)
|
|
651
|
+
|
|
652
|
+
# Done; return the response.
|
|
653
|
+
return response
|
|
654
|
+
|
|
655
|
+
async def update_instance(
|
|
656
|
+
self,
|
|
657
|
+
request: Optional[Union[instance.Instance, dict]] = None,
|
|
658
|
+
*,
|
|
659
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
660
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
661
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
662
|
+
) -> instance.Instance:
|
|
663
|
+
r"""Updates an instance within a project. This method
|
|
664
|
+
updates only the display name and type for an Instance.
|
|
665
|
+
To update other Instance properties, such as labels, use
|
|
666
|
+
PartialUpdateInstance.
|
|
667
|
+
|
|
668
|
+
Args:
|
|
669
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.Instance, dict]]):
|
|
670
|
+
The request object. A collection of Bigtable
|
|
671
|
+
[Tables][google.bigtable.admin.v2.Table] and the
|
|
672
|
+
resources that serve them. All tables in an instance are
|
|
673
|
+
served from all
|
|
674
|
+
[Clusters][google.bigtable.admin.v2.Cluster] in the
|
|
675
|
+
instance.
|
|
676
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
677
|
+
should be retried.
|
|
678
|
+
timeout (float): The timeout for this request.
|
|
679
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
680
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
681
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
682
|
+
be of type `bytes`.
|
|
683
|
+
|
|
684
|
+
Returns:
|
|
685
|
+
google.cloud.bigtable_admin_v2.types.Instance:
|
|
686
|
+
A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and
|
|
687
|
+
the resources that serve them. All tables in an
|
|
688
|
+
instance are served from all
|
|
689
|
+
[Clusters][google.bigtable.admin.v2.Cluster] in the
|
|
690
|
+
instance.
|
|
691
|
+
|
|
692
|
+
"""
|
|
693
|
+
# Create or coerce a protobuf request object.
|
|
694
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
695
|
+
# there are no flattened fields), or create one.
|
|
696
|
+
if not isinstance(request, instance.Instance):
|
|
697
|
+
request = instance.Instance(request)
|
|
698
|
+
|
|
699
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
700
|
+
# and friendly error handling.
|
|
701
|
+
rpc = self._client._transport._wrapped_methods[
|
|
702
|
+
self._client._transport.update_instance
|
|
703
|
+
]
|
|
704
|
+
|
|
705
|
+
# Certain fields should be provided within the metadata header;
|
|
706
|
+
# add these here.
|
|
707
|
+
metadata = tuple(metadata) + (
|
|
708
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
709
|
+
)
|
|
710
|
+
|
|
711
|
+
# Validate the universe domain.
|
|
712
|
+
self._client._validate_universe_domain()
|
|
713
|
+
|
|
714
|
+
# Send the request.
|
|
715
|
+
response = await rpc(
|
|
716
|
+
request,
|
|
717
|
+
retry=retry,
|
|
718
|
+
timeout=timeout,
|
|
719
|
+
metadata=metadata,
|
|
720
|
+
)
|
|
721
|
+
|
|
722
|
+
# Done; return the response.
|
|
723
|
+
return response
|
|
724
|
+
|
|
725
|
+
async def partial_update_instance(
|
|
726
|
+
self,
|
|
727
|
+
request: Optional[
|
|
728
|
+
Union[bigtable_instance_admin.PartialUpdateInstanceRequest, dict]
|
|
729
|
+
] = None,
|
|
730
|
+
*,
|
|
731
|
+
instance: Optional[gba_instance.Instance] = None,
|
|
732
|
+
update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
|
733
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
734
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
735
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
736
|
+
) -> operation_async.AsyncOperation:
|
|
737
|
+
r"""Partially updates an instance within a project. This
|
|
738
|
+
method can modify all fields of an Instance and is the
|
|
739
|
+
preferred way to update an Instance.
|
|
740
|
+
|
|
741
|
+
Args:
|
|
742
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.PartialUpdateInstanceRequest, dict]]):
|
|
743
|
+
The request object. Request message for
|
|
744
|
+
BigtableInstanceAdmin.PartialUpdateInstance.
|
|
745
|
+
instance (:class:`google.cloud.bigtable_admin_v2.types.Instance`):
|
|
746
|
+
Required. The Instance which will
|
|
747
|
+
(partially) replace the current value.
|
|
748
|
+
|
|
749
|
+
This corresponds to the ``instance`` field
|
|
750
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
751
|
+
should not be set.
|
|
752
|
+
update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
|
|
753
|
+
Required. The subset of Instance
|
|
754
|
+
fields which should be replaced. Must be
|
|
755
|
+
explicitly set.
|
|
756
|
+
|
|
757
|
+
This corresponds to the ``update_mask`` field
|
|
758
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
759
|
+
should not be set.
|
|
760
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
761
|
+
should be retried.
|
|
762
|
+
timeout (float): The timeout for this request.
|
|
763
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
764
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
765
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
766
|
+
be of type `bytes`.
|
|
767
|
+
|
|
768
|
+
Returns:
|
|
769
|
+
google.api_core.operation_async.AsyncOperation:
|
|
770
|
+
An object representing a long-running operation.
|
|
771
|
+
|
|
772
|
+
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
|
|
773
|
+
the resources that serve them. All tables in an
|
|
774
|
+
instance are served from all
|
|
775
|
+
[Clusters][google.bigtable.admin.v2.Cluster] in the
|
|
776
|
+
instance.
|
|
777
|
+
|
|
778
|
+
"""
|
|
779
|
+
# Create or coerce a protobuf request object.
|
|
780
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
781
|
+
# gotten any keyword arguments that map to the request.
|
|
782
|
+
flattened_params = [instance, update_mask]
|
|
783
|
+
has_flattened_params = (
|
|
784
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
785
|
+
)
|
|
786
|
+
if request is not None and has_flattened_params:
|
|
787
|
+
raise ValueError(
|
|
788
|
+
"If the `request` argument is set, then none of "
|
|
789
|
+
"the individual field arguments should be set."
|
|
790
|
+
)
|
|
791
|
+
|
|
792
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
793
|
+
# there are no flattened fields), or create one.
|
|
794
|
+
if not isinstance(
|
|
795
|
+
request, bigtable_instance_admin.PartialUpdateInstanceRequest
|
|
796
|
+
):
|
|
797
|
+
request = bigtable_instance_admin.PartialUpdateInstanceRequest(request)
|
|
798
|
+
|
|
799
|
+
# If we have keyword arguments corresponding to fields on the
|
|
800
|
+
# request, apply these.
|
|
801
|
+
if instance is not None:
|
|
802
|
+
request.instance = instance
|
|
803
|
+
if update_mask is not None:
|
|
804
|
+
request.update_mask = update_mask
|
|
805
|
+
|
|
806
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
807
|
+
# and friendly error handling.
|
|
808
|
+
rpc = self._client._transport._wrapped_methods[
|
|
809
|
+
self._client._transport.partial_update_instance
|
|
810
|
+
]
|
|
811
|
+
|
|
812
|
+
# Certain fields should be provided within the metadata header;
|
|
813
|
+
# add these here.
|
|
814
|
+
metadata = tuple(metadata) + (
|
|
815
|
+
gapic_v1.routing_header.to_grpc_metadata(
|
|
816
|
+
(("instance.name", request.instance.name),)
|
|
817
|
+
),
|
|
818
|
+
)
|
|
819
|
+
|
|
820
|
+
# Validate the universe domain.
|
|
821
|
+
self._client._validate_universe_domain()
|
|
822
|
+
|
|
823
|
+
# Send the request.
|
|
824
|
+
response = await rpc(
|
|
825
|
+
request,
|
|
826
|
+
retry=retry,
|
|
827
|
+
timeout=timeout,
|
|
828
|
+
metadata=metadata,
|
|
829
|
+
)
|
|
830
|
+
|
|
831
|
+
# Wrap the response in an operation future.
|
|
832
|
+
response = operation_async.from_gapic(
|
|
833
|
+
response,
|
|
834
|
+
self._client._transport.operations_client,
|
|
835
|
+
gba_instance.Instance,
|
|
836
|
+
metadata_type=bigtable_instance_admin.UpdateInstanceMetadata,
|
|
837
|
+
)
|
|
838
|
+
|
|
839
|
+
# Done; return the response.
|
|
840
|
+
return response
|
|
841
|
+
|
|
842
|
+
async def delete_instance(
|
|
843
|
+
self,
|
|
844
|
+
request: Optional[
|
|
845
|
+
Union[bigtable_instance_admin.DeleteInstanceRequest, dict]
|
|
846
|
+
] = None,
|
|
847
|
+
*,
|
|
848
|
+
name: Optional[str] = None,
|
|
849
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
850
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
851
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
852
|
+
) -> None:
|
|
853
|
+
r"""Delete an instance from a project.
|
|
854
|
+
|
|
855
|
+
Args:
|
|
856
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteInstanceRequest, dict]]):
|
|
857
|
+
The request object. Request message for
|
|
858
|
+
BigtableInstanceAdmin.DeleteInstance.
|
|
859
|
+
name (:class:`str`):
|
|
860
|
+
Required. The unique name of the instance to be deleted.
|
|
861
|
+
Values are of the form
|
|
862
|
+
``projects/{project}/instances/{instance}``.
|
|
863
|
+
|
|
864
|
+
This corresponds to the ``name`` field
|
|
865
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
866
|
+
should not be set.
|
|
867
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
868
|
+
should be retried.
|
|
869
|
+
timeout (float): The timeout for this request.
|
|
870
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
871
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
872
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
873
|
+
be of type `bytes`.
|
|
874
|
+
"""
|
|
875
|
+
# Create or coerce a protobuf request object.
|
|
876
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
877
|
+
# gotten any keyword arguments that map to the request.
|
|
878
|
+
flattened_params = [name]
|
|
879
|
+
has_flattened_params = (
|
|
880
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
881
|
+
)
|
|
882
|
+
if request is not None and has_flattened_params:
|
|
883
|
+
raise ValueError(
|
|
884
|
+
"If the `request` argument is set, then none of "
|
|
885
|
+
"the individual field arguments should be set."
|
|
886
|
+
)
|
|
887
|
+
|
|
888
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
889
|
+
# there are no flattened fields), or create one.
|
|
890
|
+
if not isinstance(request, bigtable_instance_admin.DeleteInstanceRequest):
|
|
891
|
+
request = bigtable_instance_admin.DeleteInstanceRequest(request)
|
|
892
|
+
|
|
893
|
+
# If we have keyword arguments corresponding to fields on the
|
|
894
|
+
# request, apply these.
|
|
895
|
+
if name is not None:
|
|
896
|
+
request.name = name
|
|
897
|
+
|
|
898
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
899
|
+
# and friendly error handling.
|
|
900
|
+
rpc = self._client._transport._wrapped_methods[
|
|
901
|
+
self._client._transport.delete_instance
|
|
902
|
+
]
|
|
903
|
+
|
|
904
|
+
# Certain fields should be provided within the metadata header;
|
|
905
|
+
# add these here.
|
|
906
|
+
metadata = tuple(metadata) + (
|
|
907
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
908
|
+
)
|
|
909
|
+
|
|
910
|
+
# Validate the universe domain.
|
|
911
|
+
self._client._validate_universe_domain()
|
|
912
|
+
|
|
913
|
+
# Send the request.
|
|
914
|
+
await rpc(
|
|
915
|
+
request,
|
|
916
|
+
retry=retry,
|
|
917
|
+
timeout=timeout,
|
|
918
|
+
metadata=metadata,
|
|
919
|
+
)
|
|
920
|
+
|
|
921
|
+
async def create_cluster(
|
|
922
|
+
self,
|
|
923
|
+
request: Optional[
|
|
924
|
+
Union[bigtable_instance_admin.CreateClusterRequest, dict]
|
|
925
|
+
] = None,
|
|
926
|
+
*,
|
|
927
|
+
parent: Optional[str] = None,
|
|
928
|
+
cluster_id: Optional[str] = None,
|
|
929
|
+
cluster: Optional[instance.Cluster] = None,
|
|
930
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
931
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
932
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
933
|
+
) -> operation_async.AsyncOperation:
|
|
934
|
+
r"""Creates a cluster within an instance.
|
|
935
|
+
|
|
936
|
+
Note that exactly one of Cluster.serve_nodes and
|
|
937
|
+
Cluster.cluster_config.cluster_autoscaling_config can be set. If
|
|
938
|
+
serve_nodes is set to non-zero, then the cluster is manually
|
|
939
|
+
scaled. If cluster_config.cluster_autoscaling_config is
|
|
940
|
+
non-empty, then autoscaling is enabled.
|
|
941
|
+
|
|
942
|
+
Args:
|
|
943
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateClusterRequest, dict]]):
|
|
944
|
+
The request object. Request message for
|
|
945
|
+
BigtableInstanceAdmin.CreateCluster.
|
|
946
|
+
parent (:class:`str`):
|
|
947
|
+
Required. The unique name of the instance in which to
|
|
948
|
+
create the new cluster. Values are of the form
|
|
949
|
+
``projects/{project}/instances/{instance}``.
|
|
950
|
+
|
|
951
|
+
This corresponds to the ``parent`` field
|
|
952
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
953
|
+
should not be set.
|
|
954
|
+
cluster_id (:class:`str`):
|
|
955
|
+
Required. The ID to be used when referring to the new
|
|
956
|
+
cluster within its instance, e.g., just ``mycluster``
|
|
957
|
+
rather than
|
|
958
|
+
``projects/myproject/instances/myinstance/clusters/mycluster``.
|
|
959
|
+
|
|
960
|
+
This corresponds to the ``cluster_id`` field
|
|
961
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
962
|
+
should not be set.
|
|
963
|
+
cluster (:class:`google.cloud.bigtable_admin_v2.types.Cluster`):
|
|
964
|
+
Required. The cluster to be created. Fields marked
|
|
965
|
+
``OutputOnly`` must be left blank.
|
|
966
|
+
|
|
967
|
+
This corresponds to the ``cluster`` field
|
|
968
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
969
|
+
should not be set.
|
|
970
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
971
|
+
should be retried.
|
|
972
|
+
timeout (float): The timeout for this request.
|
|
973
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
974
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
975
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
976
|
+
be of type `bytes`.
|
|
977
|
+
|
|
978
|
+
Returns:
|
|
979
|
+
google.api_core.operation_async.AsyncOperation:
|
|
980
|
+
An object representing a long-running operation.
|
|
981
|
+
|
|
982
|
+
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
|
|
983
|
+
of serving all
|
|
984
|
+
[Tables][google.bigtable.admin.v2.Table] in the
|
|
985
|
+
parent [Instance][google.bigtable.admin.v2.Instance].
|
|
986
|
+
|
|
987
|
+
"""
|
|
988
|
+
# Create or coerce a protobuf request object.
|
|
989
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
990
|
+
# gotten any keyword arguments that map to the request.
|
|
991
|
+
flattened_params = [parent, cluster_id, cluster]
|
|
992
|
+
has_flattened_params = (
|
|
993
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
994
|
+
)
|
|
995
|
+
if request is not None and has_flattened_params:
|
|
996
|
+
raise ValueError(
|
|
997
|
+
"If the `request` argument is set, then none of "
|
|
998
|
+
"the individual field arguments should be set."
|
|
999
|
+
)
|
|
1000
|
+
|
|
1001
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
1002
|
+
# there are no flattened fields), or create one.
|
|
1003
|
+
if not isinstance(request, bigtable_instance_admin.CreateClusterRequest):
|
|
1004
|
+
request = bigtable_instance_admin.CreateClusterRequest(request)
|
|
1005
|
+
|
|
1006
|
+
# If we have keyword arguments corresponding to fields on the
|
|
1007
|
+
# request, apply these.
|
|
1008
|
+
if parent is not None:
|
|
1009
|
+
request.parent = parent
|
|
1010
|
+
if cluster_id is not None:
|
|
1011
|
+
request.cluster_id = cluster_id
|
|
1012
|
+
if cluster is not None:
|
|
1013
|
+
request.cluster = cluster
|
|
1014
|
+
|
|
1015
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1016
|
+
# and friendly error handling.
|
|
1017
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1018
|
+
self._client._transport.create_cluster
|
|
1019
|
+
]
|
|
1020
|
+
|
|
1021
|
+
# Certain fields should be provided within the metadata header;
|
|
1022
|
+
# add these here.
|
|
1023
|
+
metadata = tuple(metadata) + (
|
|
1024
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
1025
|
+
)
|
|
1026
|
+
|
|
1027
|
+
# Validate the universe domain.
|
|
1028
|
+
self._client._validate_universe_domain()
|
|
1029
|
+
|
|
1030
|
+
# Send the request.
|
|
1031
|
+
response = await rpc(
|
|
1032
|
+
request,
|
|
1033
|
+
retry=retry,
|
|
1034
|
+
timeout=timeout,
|
|
1035
|
+
metadata=metadata,
|
|
1036
|
+
)
|
|
1037
|
+
|
|
1038
|
+
# Wrap the response in an operation future.
|
|
1039
|
+
response = operation_async.from_gapic(
|
|
1040
|
+
response,
|
|
1041
|
+
self._client._transport.operations_client,
|
|
1042
|
+
instance.Cluster,
|
|
1043
|
+
metadata_type=bigtable_instance_admin.CreateClusterMetadata,
|
|
1044
|
+
)
|
|
1045
|
+
|
|
1046
|
+
# Done; return the response.
|
|
1047
|
+
return response
|
|
1048
|
+
|
|
1049
|
+
async def get_cluster(
|
|
1050
|
+
self,
|
|
1051
|
+
request: Optional[
|
|
1052
|
+
Union[bigtable_instance_admin.GetClusterRequest, dict]
|
|
1053
|
+
] = None,
|
|
1054
|
+
*,
|
|
1055
|
+
name: Optional[str] = None,
|
|
1056
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1057
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
1058
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1059
|
+
) -> instance.Cluster:
|
|
1060
|
+
r"""Gets information about a cluster.
|
|
1061
|
+
|
|
1062
|
+
Args:
|
|
1063
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetClusterRequest, dict]]):
|
|
1064
|
+
The request object. Request message for
|
|
1065
|
+
BigtableInstanceAdmin.GetCluster.
|
|
1066
|
+
name (:class:`str`):
|
|
1067
|
+
Required. The unique name of the requested cluster.
|
|
1068
|
+
Values are of the form
|
|
1069
|
+
``projects/{project}/instances/{instance}/clusters/{cluster}``.
|
|
1070
|
+
|
|
1071
|
+
This corresponds to the ``name`` field
|
|
1072
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1073
|
+
should not be set.
|
|
1074
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
1075
|
+
should be retried.
|
|
1076
|
+
timeout (float): The timeout for this request.
|
|
1077
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1078
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1079
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1080
|
+
be of type `bytes`.
|
|
1081
|
+
|
|
1082
|
+
Returns:
|
|
1083
|
+
google.cloud.bigtable_admin_v2.types.Cluster:
|
|
1084
|
+
A resizable group of nodes in a particular cloud location, capable
|
|
1085
|
+
of serving all
|
|
1086
|
+
[Tables][google.bigtable.admin.v2.Table] in the
|
|
1087
|
+
parent [Instance][google.bigtable.admin.v2.Instance].
|
|
1088
|
+
|
|
1089
|
+
"""
|
|
1090
|
+
# Create or coerce a protobuf request object.
|
|
1091
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
1092
|
+
# gotten any keyword arguments that map to the request.
|
|
1093
|
+
flattened_params = [name]
|
|
1094
|
+
has_flattened_params = (
|
|
1095
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
1096
|
+
)
|
|
1097
|
+
if request is not None and has_flattened_params:
|
|
1098
|
+
raise ValueError(
|
|
1099
|
+
"If the `request` argument is set, then none of "
|
|
1100
|
+
"the individual field arguments should be set."
|
|
1101
|
+
)
|
|
1102
|
+
|
|
1103
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
1104
|
+
# there are no flattened fields), or create one.
|
|
1105
|
+
if not isinstance(request, bigtable_instance_admin.GetClusterRequest):
|
|
1106
|
+
request = bigtable_instance_admin.GetClusterRequest(request)
|
|
1107
|
+
|
|
1108
|
+
# If we have keyword arguments corresponding to fields on the
|
|
1109
|
+
# request, apply these.
|
|
1110
|
+
if name is not None:
|
|
1111
|
+
request.name = name
|
|
1112
|
+
|
|
1113
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1114
|
+
# and friendly error handling.
|
|
1115
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1116
|
+
self._client._transport.get_cluster
|
|
1117
|
+
]
|
|
1118
|
+
|
|
1119
|
+
# Certain fields should be provided within the metadata header;
|
|
1120
|
+
# add these here.
|
|
1121
|
+
metadata = tuple(metadata) + (
|
|
1122
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
1123
|
+
)
|
|
1124
|
+
|
|
1125
|
+
# Validate the universe domain.
|
|
1126
|
+
self._client._validate_universe_domain()
|
|
1127
|
+
|
|
1128
|
+
# Send the request.
|
|
1129
|
+
response = await rpc(
|
|
1130
|
+
request,
|
|
1131
|
+
retry=retry,
|
|
1132
|
+
timeout=timeout,
|
|
1133
|
+
metadata=metadata,
|
|
1134
|
+
)
|
|
1135
|
+
|
|
1136
|
+
# Done; return the response.
|
|
1137
|
+
return response
|
|
1138
|
+
|
|
1139
|
+
async def list_clusters(
|
|
1140
|
+
self,
|
|
1141
|
+
request: Optional[
|
|
1142
|
+
Union[bigtable_instance_admin.ListClustersRequest, dict]
|
|
1143
|
+
] = None,
|
|
1144
|
+
*,
|
|
1145
|
+
parent: Optional[str] = None,
|
|
1146
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1147
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
1148
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1149
|
+
) -> bigtable_instance_admin.ListClustersResponse:
|
|
1150
|
+
r"""Lists information about clusters in an instance.
|
|
1151
|
+
|
|
1152
|
+
Args:
|
|
1153
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListClustersRequest, dict]]):
|
|
1154
|
+
The request object. Request message for
|
|
1155
|
+
BigtableInstanceAdmin.ListClusters.
|
|
1156
|
+
parent (:class:`str`):
|
|
1157
|
+
Required. The unique name of the instance for which a
|
|
1158
|
+
list of clusters is requested. Values are of the form
|
|
1159
|
+
``projects/{project}/instances/{instance}``. Use
|
|
1160
|
+
``{instance} = '-'`` to list Clusters for all Instances
|
|
1161
|
+
in a project, e.g., ``projects/myproject/instances/-``.
|
|
1162
|
+
|
|
1163
|
+
This corresponds to the ``parent`` field
|
|
1164
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1165
|
+
should not be set.
|
|
1166
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
1167
|
+
should be retried.
|
|
1168
|
+
timeout (float): The timeout for this request.
|
|
1169
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1170
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1171
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1172
|
+
be of type `bytes`.
|
|
1173
|
+
|
|
1174
|
+
Returns:
|
|
1175
|
+
google.cloud.bigtable_admin_v2.types.ListClustersResponse:
|
|
1176
|
+
Response message for
|
|
1177
|
+
BigtableInstanceAdmin.ListClusters.
|
|
1178
|
+
|
|
1179
|
+
"""
|
|
1180
|
+
# Create or coerce a protobuf request object.
|
|
1181
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
1182
|
+
# gotten any keyword arguments that map to the request.
|
|
1183
|
+
flattened_params = [parent]
|
|
1184
|
+
has_flattened_params = (
|
|
1185
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
1186
|
+
)
|
|
1187
|
+
if request is not None and has_flattened_params:
|
|
1188
|
+
raise ValueError(
|
|
1189
|
+
"If the `request` argument is set, then none of "
|
|
1190
|
+
"the individual field arguments should be set."
|
|
1191
|
+
)
|
|
1192
|
+
|
|
1193
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
1194
|
+
# there are no flattened fields), or create one.
|
|
1195
|
+
if not isinstance(request, bigtable_instance_admin.ListClustersRequest):
|
|
1196
|
+
request = bigtable_instance_admin.ListClustersRequest(request)
|
|
1197
|
+
|
|
1198
|
+
# If we have keyword arguments corresponding to fields on the
|
|
1199
|
+
# request, apply these.
|
|
1200
|
+
if parent is not None:
|
|
1201
|
+
request.parent = parent
|
|
1202
|
+
|
|
1203
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1204
|
+
# and friendly error handling.
|
|
1205
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1206
|
+
self._client._transport.list_clusters
|
|
1207
|
+
]
|
|
1208
|
+
|
|
1209
|
+
# Certain fields should be provided within the metadata header;
|
|
1210
|
+
# add these here.
|
|
1211
|
+
metadata = tuple(metadata) + (
|
|
1212
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
1213
|
+
)
|
|
1214
|
+
|
|
1215
|
+
# Validate the universe domain.
|
|
1216
|
+
self._client._validate_universe_domain()
|
|
1217
|
+
|
|
1218
|
+
# Send the request.
|
|
1219
|
+
response = await rpc(
|
|
1220
|
+
request,
|
|
1221
|
+
retry=retry,
|
|
1222
|
+
timeout=timeout,
|
|
1223
|
+
metadata=metadata,
|
|
1224
|
+
)
|
|
1225
|
+
|
|
1226
|
+
# Done; return the response.
|
|
1227
|
+
return response
|
|
1228
|
+
|
|
1229
|
+
async def update_cluster(
|
|
1230
|
+
self,
|
|
1231
|
+
request: Optional[Union[instance.Cluster, dict]] = None,
|
|
1232
|
+
*,
|
|
1233
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1234
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
1235
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1236
|
+
) -> operation_async.AsyncOperation:
|
|
1237
|
+
r"""Updates a cluster within an instance.
|
|
1238
|
+
|
|
1239
|
+
Note that UpdateCluster does not support updating
|
|
1240
|
+
cluster_config.cluster_autoscaling_config. In order to update
|
|
1241
|
+
it, you must use PartialUpdateCluster.
|
|
1242
|
+
|
|
1243
|
+
Args:
|
|
1244
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.Cluster, dict]]):
|
|
1245
|
+
The request object. A resizable group of nodes in a particular cloud
|
|
1246
|
+
location, capable of serving all
|
|
1247
|
+
[Tables][google.bigtable.admin.v2.Table] in the parent
|
|
1248
|
+
[Instance][google.bigtable.admin.v2.Instance].
|
|
1249
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
1250
|
+
should be retried.
|
|
1251
|
+
timeout (float): The timeout for this request.
|
|
1252
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1253
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1254
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1255
|
+
be of type `bytes`.
|
|
1256
|
+
|
|
1257
|
+
Returns:
|
|
1258
|
+
google.api_core.operation_async.AsyncOperation:
|
|
1259
|
+
An object representing a long-running operation.
|
|
1260
|
+
|
|
1261
|
+
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
|
|
1262
|
+
of serving all
|
|
1263
|
+
[Tables][google.bigtable.admin.v2.Table] in the
|
|
1264
|
+
parent [Instance][google.bigtable.admin.v2.Instance].
|
|
1265
|
+
|
|
1266
|
+
"""
|
|
1267
|
+
# Create or coerce a protobuf request object.
|
|
1268
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
1269
|
+
# there are no flattened fields), or create one.
|
|
1270
|
+
if not isinstance(request, instance.Cluster):
|
|
1271
|
+
request = instance.Cluster(request)
|
|
1272
|
+
|
|
1273
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1274
|
+
# and friendly error handling.
|
|
1275
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1276
|
+
self._client._transport.update_cluster
|
|
1277
|
+
]
|
|
1278
|
+
|
|
1279
|
+
# Certain fields should be provided within the metadata header;
|
|
1280
|
+
# add these here.
|
|
1281
|
+
metadata = tuple(metadata) + (
|
|
1282
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
1283
|
+
)
|
|
1284
|
+
|
|
1285
|
+
# Validate the universe domain.
|
|
1286
|
+
self._client._validate_universe_domain()
|
|
1287
|
+
|
|
1288
|
+
# Send the request.
|
|
1289
|
+
response = await rpc(
|
|
1290
|
+
request,
|
|
1291
|
+
retry=retry,
|
|
1292
|
+
timeout=timeout,
|
|
1293
|
+
metadata=metadata,
|
|
1294
|
+
)
|
|
1295
|
+
|
|
1296
|
+
# Wrap the response in an operation future.
|
|
1297
|
+
response = operation_async.from_gapic(
|
|
1298
|
+
response,
|
|
1299
|
+
self._client._transport.operations_client,
|
|
1300
|
+
instance.Cluster,
|
|
1301
|
+
metadata_type=bigtable_instance_admin.UpdateClusterMetadata,
|
|
1302
|
+
)
|
|
1303
|
+
|
|
1304
|
+
# Done; return the response.
|
|
1305
|
+
return response
|
|
1306
|
+
|
|
1307
|
+
async def partial_update_cluster(
|
|
1308
|
+
self,
|
|
1309
|
+
request: Optional[
|
|
1310
|
+
Union[bigtable_instance_admin.PartialUpdateClusterRequest, dict]
|
|
1311
|
+
] = None,
|
|
1312
|
+
*,
|
|
1313
|
+
cluster: Optional[instance.Cluster] = None,
|
|
1314
|
+
update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
|
1315
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1316
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
1317
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1318
|
+
) -> operation_async.AsyncOperation:
|
|
1319
|
+
r"""Partially updates a cluster within a project. This method is the
|
|
1320
|
+
preferred way to update a Cluster.
|
|
1321
|
+
|
|
1322
|
+
To enable and update autoscaling, set
|
|
1323
|
+
cluster_config.cluster_autoscaling_config. When autoscaling is
|
|
1324
|
+
enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning
|
|
1325
|
+
that updates to it are ignored. Note that an update cannot
|
|
1326
|
+
simultaneously set serve_nodes to non-zero and
|
|
1327
|
+
cluster_config.cluster_autoscaling_config to non-empty, and also
|
|
1328
|
+
specify both in the update_mask.
|
|
1329
|
+
|
|
1330
|
+
To disable autoscaling, clear
|
|
1331
|
+
cluster_config.cluster_autoscaling_config, and explicitly set a
|
|
1332
|
+
serve_node count via the update_mask.
|
|
1333
|
+
|
|
1334
|
+
Args:
|
|
1335
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.PartialUpdateClusterRequest, dict]]):
|
|
1336
|
+
The request object. Request message for
|
|
1337
|
+
BigtableInstanceAdmin.PartialUpdateCluster.
|
|
1338
|
+
cluster (:class:`google.cloud.bigtable_admin_v2.types.Cluster`):
|
|
1339
|
+
Required. The Cluster which contains the partial updates
|
|
1340
|
+
to be applied, subject to the update_mask.
|
|
1341
|
+
|
|
1342
|
+
This corresponds to the ``cluster`` field
|
|
1343
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1344
|
+
should not be set.
|
|
1345
|
+
update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
|
|
1346
|
+
Required. The subset of Cluster
|
|
1347
|
+
fields which should be replaced.
|
|
1348
|
+
|
|
1349
|
+
This corresponds to the ``update_mask`` field
|
|
1350
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1351
|
+
should not be set.
|
|
1352
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
1353
|
+
should be retried.
|
|
1354
|
+
timeout (float): The timeout for this request.
|
|
1355
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1356
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1357
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1358
|
+
be of type `bytes`.
|
|
1359
|
+
|
|
1360
|
+
Returns:
|
|
1361
|
+
google.api_core.operation_async.AsyncOperation:
|
|
1362
|
+
An object representing a long-running operation.
|
|
1363
|
+
|
|
1364
|
+
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
|
|
1365
|
+
of serving all
|
|
1366
|
+
[Tables][google.bigtable.admin.v2.Table] in the
|
|
1367
|
+
parent [Instance][google.bigtable.admin.v2.Instance].
|
|
1368
|
+
|
|
1369
|
+
"""
|
|
1370
|
+
# Create or coerce a protobuf request object.
|
|
1371
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
1372
|
+
# gotten any keyword arguments that map to the request.
|
|
1373
|
+
flattened_params = [cluster, update_mask]
|
|
1374
|
+
has_flattened_params = (
|
|
1375
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
1376
|
+
)
|
|
1377
|
+
if request is not None and has_flattened_params:
|
|
1378
|
+
raise ValueError(
|
|
1379
|
+
"If the `request` argument is set, then none of "
|
|
1380
|
+
"the individual field arguments should be set."
|
|
1381
|
+
)
|
|
1382
|
+
|
|
1383
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
1384
|
+
# there are no flattened fields), or create one.
|
|
1385
|
+
if not isinstance(request, bigtable_instance_admin.PartialUpdateClusterRequest):
|
|
1386
|
+
request = bigtable_instance_admin.PartialUpdateClusterRequest(request)
|
|
1387
|
+
|
|
1388
|
+
# If we have keyword arguments corresponding to fields on the
|
|
1389
|
+
# request, apply these.
|
|
1390
|
+
if cluster is not None:
|
|
1391
|
+
request.cluster = cluster
|
|
1392
|
+
if update_mask is not None:
|
|
1393
|
+
request.update_mask = update_mask
|
|
1394
|
+
|
|
1395
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1396
|
+
# and friendly error handling.
|
|
1397
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1398
|
+
self._client._transport.partial_update_cluster
|
|
1399
|
+
]
|
|
1400
|
+
|
|
1401
|
+
# Certain fields should be provided within the metadata header;
|
|
1402
|
+
# add these here.
|
|
1403
|
+
metadata = tuple(metadata) + (
|
|
1404
|
+
gapic_v1.routing_header.to_grpc_metadata(
|
|
1405
|
+
(("cluster.name", request.cluster.name),)
|
|
1406
|
+
),
|
|
1407
|
+
)
|
|
1408
|
+
|
|
1409
|
+
# Validate the universe domain.
|
|
1410
|
+
self._client._validate_universe_domain()
|
|
1411
|
+
|
|
1412
|
+
# Send the request.
|
|
1413
|
+
response = await rpc(
|
|
1414
|
+
request,
|
|
1415
|
+
retry=retry,
|
|
1416
|
+
timeout=timeout,
|
|
1417
|
+
metadata=metadata,
|
|
1418
|
+
)
|
|
1419
|
+
|
|
1420
|
+
# Wrap the response in an operation future.
|
|
1421
|
+
response = operation_async.from_gapic(
|
|
1422
|
+
response,
|
|
1423
|
+
self._client._transport.operations_client,
|
|
1424
|
+
instance.Cluster,
|
|
1425
|
+
metadata_type=bigtable_instance_admin.PartialUpdateClusterMetadata,
|
|
1426
|
+
)
|
|
1427
|
+
|
|
1428
|
+
# Done; return the response.
|
|
1429
|
+
return response
|
|
1430
|
+
|
|
1431
|
+
async def delete_cluster(
|
|
1432
|
+
self,
|
|
1433
|
+
request: Optional[
|
|
1434
|
+
Union[bigtable_instance_admin.DeleteClusterRequest, dict]
|
|
1435
|
+
] = None,
|
|
1436
|
+
*,
|
|
1437
|
+
name: Optional[str] = None,
|
|
1438
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1439
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
1440
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1441
|
+
) -> None:
|
|
1442
|
+
r"""Deletes a cluster from an instance.
|
|
1443
|
+
|
|
1444
|
+
Args:
|
|
1445
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteClusterRequest, dict]]):
|
|
1446
|
+
The request object. Request message for
|
|
1447
|
+
BigtableInstanceAdmin.DeleteCluster.
|
|
1448
|
+
name (:class:`str`):
|
|
1449
|
+
Required. The unique name of the cluster to be deleted.
|
|
1450
|
+
Values are of the form
|
|
1451
|
+
``projects/{project}/instances/{instance}/clusters/{cluster}``.
|
|
1452
|
+
|
|
1453
|
+
This corresponds to the ``name`` field
|
|
1454
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1455
|
+
should not be set.
|
|
1456
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
1457
|
+
should be retried.
|
|
1458
|
+
timeout (float): The timeout for this request.
|
|
1459
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1460
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1461
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1462
|
+
be of type `bytes`.
|
|
1463
|
+
"""
|
|
1464
|
+
# Create or coerce a protobuf request object.
|
|
1465
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
1466
|
+
# gotten any keyword arguments that map to the request.
|
|
1467
|
+
flattened_params = [name]
|
|
1468
|
+
has_flattened_params = (
|
|
1469
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
1470
|
+
)
|
|
1471
|
+
if request is not None and has_flattened_params:
|
|
1472
|
+
raise ValueError(
|
|
1473
|
+
"If the `request` argument is set, then none of "
|
|
1474
|
+
"the individual field arguments should be set."
|
|
1475
|
+
)
|
|
1476
|
+
|
|
1477
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
1478
|
+
# there are no flattened fields), or create one.
|
|
1479
|
+
if not isinstance(request, bigtable_instance_admin.DeleteClusterRequest):
|
|
1480
|
+
request = bigtable_instance_admin.DeleteClusterRequest(request)
|
|
1481
|
+
|
|
1482
|
+
# If we have keyword arguments corresponding to fields on the
|
|
1483
|
+
# request, apply these.
|
|
1484
|
+
if name is not None:
|
|
1485
|
+
request.name = name
|
|
1486
|
+
|
|
1487
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1488
|
+
# and friendly error handling.
|
|
1489
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1490
|
+
self._client._transport.delete_cluster
|
|
1491
|
+
]
|
|
1492
|
+
|
|
1493
|
+
# Certain fields should be provided within the metadata header;
|
|
1494
|
+
# add these here.
|
|
1495
|
+
metadata = tuple(metadata) + (
|
|
1496
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
1497
|
+
)
|
|
1498
|
+
|
|
1499
|
+
# Validate the universe domain.
|
|
1500
|
+
self._client._validate_universe_domain()
|
|
1501
|
+
|
|
1502
|
+
# Send the request.
|
|
1503
|
+
await rpc(
|
|
1504
|
+
request,
|
|
1505
|
+
retry=retry,
|
|
1506
|
+
timeout=timeout,
|
|
1507
|
+
metadata=metadata,
|
|
1508
|
+
)
|
|
1509
|
+
|
|
1510
|
+
async def create_app_profile(
|
|
1511
|
+
self,
|
|
1512
|
+
request: Optional[
|
|
1513
|
+
Union[bigtable_instance_admin.CreateAppProfileRequest, dict]
|
|
1514
|
+
] = None,
|
|
1515
|
+
*,
|
|
1516
|
+
parent: Optional[str] = None,
|
|
1517
|
+
app_profile_id: Optional[str] = None,
|
|
1518
|
+
app_profile: Optional[instance.AppProfile] = None,
|
|
1519
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1520
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
1521
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1522
|
+
) -> instance.AppProfile:
|
|
1523
|
+
r"""Creates an app profile within an instance.
|
|
1524
|
+
|
|
1525
|
+
Args:
|
|
1526
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateAppProfileRequest, dict]]):
|
|
1527
|
+
The request object. Request message for
|
|
1528
|
+
BigtableInstanceAdmin.CreateAppProfile.
|
|
1529
|
+
parent (:class:`str`):
|
|
1530
|
+
Required. The unique name of the instance in which to
|
|
1531
|
+
create the new app profile. Values are of the form
|
|
1532
|
+
``projects/{project}/instances/{instance}``.
|
|
1533
|
+
|
|
1534
|
+
This corresponds to the ``parent`` field
|
|
1535
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1536
|
+
should not be set.
|
|
1537
|
+
app_profile_id (:class:`str`):
|
|
1538
|
+
Required. The ID to be used when referring to the new
|
|
1539
|
+
app profile within its instance, e.g., just
|
|
1540
|
+
``myprofile`` rather than
|
|
1541
|
+
``projects/myproject/instances/myinstance/appProfiles/myprofile``.
|
|
1542
|
+
|
|
1543
|
+
This corresponds to the ``app_profile_id`` field
|
|
1544
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1545
|
+
should not be set.
|
|
1546
|
+
app_profile (:class:`google.cloud.bigtable_admin_v2.types.AppProfile`):
|
|
1547
|
+
Required. The app profile to be created. Fields marked
|
|
1548
|
+
``OutputOnly`` will be ignored.
|
|
1549
|
+
|
|
1550
|
+
This corresponds to the ``app_profile`` field
|
|
1551
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1552
|
+
should not be set.
|
|
1553
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
1554
|
+
should be retried.
|
|
1555
|
+
timeout (float): The timeout for this request.
|
|
1556
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1557
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1558
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1559
|
+
be of type `bytes`.
|
|
1560
|
+
|
|
1561
|
+
Returns:
|
|
1562
|
+
google.cloud.bigtable_admin_v2.types.AppProfile:
|
|
1563
|
+
A configuration object describing how
|
|
1564
|
+
Cloud Bigtable should treat traffic from
|
|
1565
|
+
a particular end user application.
|
|
1566
|
+
|
|
1567
|
+
"""
|
|
1568
|
+
# Create or coerce a protobuf request object.
|
|
1569
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
1570
|
+
# gotten any keyword arguments that map to the request.
|
|
1571
|
+
flattened_params = [parent, app_profile_id, app_profile]
|
|
1572
|
+
has_flattened_params = (
|
|
1573
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
1574
|
+
)
|
|
1575
|
+
if request is not None and has_flattened_params:
|
|
1576
|
+
raise ValueError(
|
|
1577
|
+
"If the `request` argument is set, then none of "
|
|
1578
|
+
"the individual field arguments should be set."
|
|
1579
|
+
)
|
|
1580
|
+
|
|
1581
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
1582
|
+
# there are no flattened fields), or create one.
|
|
1583
|
+
if not isinstance(request, bigtable_instance_admin.CreateAppProfileRequest):
|
|
1584
|
+
request = bigtable_instance_admin.CreateAppProfileRequest(request)
|
|
1585
|
+
|
|
1586
|
+
# If we have keyword arguments corresponding to fields on the
|
|
1587
|
+
# request, apply these.
|
|
1588
|
+
if parent is not None:
|
|
1589
|
+
request.parent = parent
|
|
1590
|
+
if app_profile_id is not None:
|
|
1591
|
+
request.app_profile_id = app_profile_id
|
|
1592
|
+
if app_profile is not None:
|
|
1593
|
+
request.app_profile = app_profile
|
|
1594
|
+
|
|
1595
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1596
|
+
# and friendly error handling.
|
|
1597
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1598
|
+
self._client._transport.create_app_profile
|
|
1599
|
+
]
|
|
1600
|
+
|
|
1601
|
+
# Certain fields should be provided within the metadata header;
|
|
1602
|
+
# add these here.
|
|
1603
|
+
metadata = tuple(metadata) + (
|
|
1604
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
1605
|
+
)
|
|
1606
|
+
|
|
1607
|
+
# Validate the universe domain.
|
|
1608
|
+
self._client._validate_universe_domain()
|
|
1609
|
+
|
|
1610
|
+
# Send the request.
|
|
1611
|
+
response = await rpc(
|
|
1612
|
+
request,
|
|
1613
|
+
retry=retry,
|
|
1614
|
+
timeout=timeout,
|
|
1615
|
+
metadata=metadata,
|
|
1616
|
+
)
|
|
1617
|
+
|
|
1618
|
+
# Done; return the response.
|
|
1619
|
+
return response
|
|
1620
|
+
|
|
1621
|
+
async def get_app_profile(
|
|
1622
|
+
self,
|
|
1623
|
+
request: Optional[
|
|
1624
|
+
Union[bigtable_instance_admin.GetAppProfileRequest, dict]
|
|
1625
|
+
] = None,
|
|
1626
|
+
*,
|
|
1627
|
+
name: Optional[str] = None,
|
|
1628
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1629
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
1630
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1631
|
+
) -> instance.AppProfile:
|
|
1632
|
+
r"""Gets information about an app profile.
|
|
1633
|
+
|
|
1634
|
+
Args:
|
|
1635
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetAppProfileRequest, dict]]):
|
|
1636
|
+
The request object. Request message for
|
|
1637
|
+
BigtableInstanceAdmin.GetAppProfile.
|
|
1638
|
+
name (:class:`str`):
|
|
1639
|
+
Required. The unique name of the requested app profile.
|
|
1640
|
+
Values are of the form
|
|
1641
|
+
``projects/{project}/instances/{instance}/appProfiles/{app_profile}``.
|
|
1642
|
+
|
|
1643
|
+
This corresponds to the ``name`` field
|
|
1644
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1645
|
+
should not be set.
|
|
1646
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
1647
|
+
should be retried.
|
|
1648
|
+
timeout (float): The timeout for this request.
|
|
1649
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1650
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1651
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1652
|
+
be of type `bytes`.
|
|
1653
|
+
|
|
1654
|
+
Returns:
|
|
1655
|
+
google.cloud.bigtable_admin_v2.types.AppProfile:
|
|
1656
|
+
A configuration object describing how
|
|
1657
|
+
Cloud Bigtable should treat traffic from
|
|
1658
|
+
a particular end user application.
|
|
1659
|
+
|
|
1660
|
+
"""
|
|
1661
|
+
# Create or coerce a protobuf request object.
|
|
1662
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
1663
|
+
# gotten any keyword arguments that map to the request.
|
|
1664
|
+
flattened_params = [name]
|
|
1665
|
+
has_flattened_params = (
|
|
1666
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
1667
|
+
)
|
|
1668
|
+
if request is not None and has_flattened_params:
|
|
1669
|
+
raise ValueError(
|
|
1670
|
+
"If the `request` argument is set, then none of "
|
|
1671
|
+
"the individual field arguments should be set."
|
|
1672
|
+
)
|
|
1673
|
+
|
|
1674
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
1675
|
+
# there are no flattened fields), or create one.
|
|
1676
|
+
if not isinstance(request, bigtable_instance_admin.GetAppProfileRequest):
|
|
1677
|
+
request = bigtable_instance_admin.GetAppProfileRequest(request)
|
|
1678
|
+
|
|
1679
|
+
# If we have keyword arguments corresponding to fields on the
|
|
1680
|
+
# request, apply these.
|
|
1681
|
+
if name is not None:
|
|
1682
|
+
request.name = name
|
|
1683
|
+
|
|
1684
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1685
|
+
# and friendly error handling.
|
|
1686
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1687
|
+
self._client._transport.get_app_profile
|
|
1688
|
+
]
|
|
1689
|
+
|
|
1690
|
+
# Certain fields should be provided within the metadata header;
|
|
1691
|
+
# add these here.
|
|
1692
|
+
metadata = tuple(metadata) + (
|
|
1693
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
1694
|
+
)
|
|
1695
|
+
|
|
1696
|
+
# Validate the universe domain.
|
|
1697
|
+
self._client._validate_universe_domain()
|
|
1698
|
+
|
|
1699
|
+
# Send the request.
|
|
1700
|
+
response = await rpc(
|
|
1701
|
+
request,
|
|
1702
|
+
retry=retry,
|
|
1703
|
+
timeout=timeout,
|
|
1704
|
+
metadata=metadata,
|
|
1705
|
+
)
|
|
1706
|
+
|
|
1707
|
+
# Done; return the response.
|
|
1708
|
+
return response
|
|
1709
|
+
|
|
1710
|
+
async def list_app_profiles(
|
|
1711
|
+
self,
|
|
1712
|
+
request: Optional[
|
|
1713
|
+
Union[bigtable_instance_admin.ListAppProfilesRequest, dict]
|
|
1714
|
+
] = None,
|
|
1715
|
+
*,
|
|
1716
|
+
parent: Optional[str] = None,
|
|
1717
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1718
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
1719
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1720
|
+
) -> pagers.ListAppProfilesAsyncPager:
|
|
1721
|
+
r"""Lists information about app profiles in an instance.
|
|
1722
|
+
|
|
1723
|
+
Args:
|
|
1724
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListAppProfilesRequest, dict]]):
|
|
1725
|
+
The request object. Request message for
|
|
1726
|
+
BigtableInstanceAdmin.ListAppProfiles.
|
|
1727
|
+
parent (:class:`str`):
|
|
1728
|
+
Required. The unique name of the instance for which a
|
|
1729
|
+
list of app profiles is requested. Values are of the
|
|
1730
|
+
form ``projects/{project}/instances/{instance}``. Use
|
|
1731
|
+
``{instance} = '-'`` to list AppProfiles for all
|
|
1732
|
+
Instances in a project, e.g.,
|
|
1733
|
+
``projects/myproject/instances/-``.
|
|
1734
|
+
|
|
1735
|
+
This corresponds to the ``parent`` field
|
|
1736
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1737
|
+
should not be set.
|
|
1738
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
1739
|
+
should be retried.
|
|
1740
|
+
timeout (float): The timeout for this request.
|
|
1741
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1742
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1743
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1744
|
+
be of type `bytes`.
|
|
1745
|
+
|
|
1746
|
+
Returns:
|
|
1747
|
+
google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListAppProfilesAsyncPager:
|
|
1748
|
+
Response message for
|
|
1749
|
+
BigtableInstanceAdmin.ListAppProfiles.
|
|
1750
|
+
Iterating over this object will yield
|
|
1751
|
+
results and resolve additional pages
|
|
1752
|
+
automatically.
|
|
1753
|
+
|
|
1754
|
+
"""
|
|
1755
|
+
# Create or coerce a protobuf request object.
|
|
1756
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
1757
|
+
# gotten any keyword arguments that map to the request.
|
|
1758
|
+
flattened_params = [parent]
|
|
1759
|
+
has_flattened_params = (
|
|
1760
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
1761
|
+
)
|
|
1762
|
+
if request is not None and has_flattened_params:
|
|
1763
|
+
raise ValueError(
|
|
1764
|
+
"If the `request` argument is set, then none of "
|
|
1765
|
+
"the individual field arguments should be set."
|
|
1766
|
+
)
|
|
1767
|
+
|
|
1768
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
1769
|
+
# there are no flattened fields), or create one.
|
|
1770
|
+
if not isinstance(request, bigtable_instance_admin.ListAppProfilesRequest):
|
|
1771
|
+
request = bigtable_instance_admin.ListAppProfilesRequest(request)
|
|
1772
|
+
|
|
1773
|
+
# If we have keyword arguments corresponding to fields on the
|
|
1774
|
+
# request, apply these.
|
|
1775
|
+
if parent is not None:
|
|
1776
|
+
request.parent = parent
|
|
1777
|
+
|
|
1778
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1779
|
+
# and friendly error handling.
|
|
1780
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1781
|
+
self._client._transport.list_app_profiles
|
|
1782
|
+
]
|
|
1783
|
+
|
|
1784
|
+
# Certain fields should be provided within the metadata header;
|
|
1785
|
+
# add these here.
|
|
1786
|
+
metadata = tuple(metadata) + (
|
|
1787
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
1788
|
+
)
|
|
1789
|
+
|
|
1790
|
+
# Validate the universe domain.
|
|
1791
|
+
self._client._validate_universe_domain()
|
|
1792
|
+
|
|
1793
|
+
# Send the request.
|
|
1794
|
+
response = await rpc(
|
|
1795
|
+
request,
|
|
1796
|
+
retry=retry,
|
|
1797
|
+
timeout=timeout,
|
|
1798
|
+
metadata=metadata,
|
|
1799
|
+
)
|
|
1800
|
+
|
|
1801
|
+
# This method is paged; wrap the response in a pager, which provides
|
|
1802
|
+
# an `__aiter__` convenience method.
|
|
1803
|
+
response = pagers.ListAppProfilesAsyncPager(
|
|
1804
|
+
method=rpc,
|
|
1805
|
+
request=request,
|
|
1806
|
+
response=response,
|
|
1807
|
+
retry=retry,
|
|
1808
|
+
timeout=timeout,
|
|
1809
|
+
metadata=metadata,
|
|
1810
|
+
)
|
|
1811
|
+
|
|
1812
|
+
# Done; return the response.
|
|
1813
|
+
return response
|
|
1814
|
+
|
|
1815
|
+
async def update_app_profile(
|
|
1816
|
+
self,
|
|
1817
|
+
request: Optional[
|
|
1818
|
+
Union[bigtable_instance_admin.UpdateAppProfileRequest, dict]
|
|
1819
|
+
] = None,
|
|
1820
|
+
*,
|
|
1821
|
+
app_profile: Optional[instance.AppProfile] = None,
|
|
1822
|
+
update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
|
1823
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1824
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
1825
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1826
|
+
) -> operation_async.AsyncOperation:
|
|
1827
|
+
r"""Updates an app profile within an instance.
|
|
1828
|
+
|
|
1829
|
+
Args:
|
|
1830
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateAppProfileRequest, dict]]):
|
|
1831
|
+
The request object. Request message for
|
|
1832
|
+
BigtableInstanceAdmin.UpdateAppProfile.
|
|
1833
|
+
app_profile (:class:`google.cloud.bigtable_admin_v2.types.AppProfile`):
|
|
1834
|
+
Required. The app profile which will
|
|
1835
|
+
(partially) replace the current value.
|
|
1836
|
+
|
|
1837
|
+
This corresponds to the ``app_profile`` field
|
|
1838
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1839
|
+
should not be set.
|
|
1840
|
+
update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
|
|
1841
|
+
Required. The subset of app profile
|
|
1842
|
+
fields which should be replaced. If
|
|
1843
|
+
unset, all fields will be replaced.
|
|
1844
|
+
|
|
1845
|
+
This corresponds to the ``update_mask`` field
|
|
1846
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1847
|
+
should not be set.
|
|
1848
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
1849
|
+
should be retried.
|
|
1850
|
+
timeout (float): The timeout for this request.
|
|
1851
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1852
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1853
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1854
|
+
be of type `bytes`.
|
|
1855
|
+
|
|
1856
|
+
Returns:
|
|
1857
|
+
google.api_core.operation_async.AsyncOperation:
|
|
1858
|
+
An object representing a long-running operation.
|
|
1859
|
+
|
|
1860
|
+
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
|
|
1861
|
+
from a particular end user application.
|
|
1862
|
+
|
|
1863
|
+
"""
|
|
1864
|
+
# Create or coerce a protobuf request object.
|
|
1865
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
1866
|
+
# gotten any keyword arguments that map to the request.
|
|
1867
|
+
flattened_params = [app_profile, update_mask]
|
|
1868
|
+
has_flattened_params = (
|
|
1869
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
1870
|
+
)
|
|
1871
|
+
if request is not None and has_flattened_params:
|
|
1872
|
+
raise ValueError(
|
|
1873
|
+
"If the `request` argument is set, then none of "
|
|
1874
|
+
"the individual field arguments should be set."
|
|
1875
|
+
)
|
|
1876
|
+
|
|
1877
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
1878
|
+
# there are no flattened fields), or create one.
|
|
1879
|
+
if not isinstance(request, bigtable_instance_admin.UpdateAppProfileRequest):
|
|
1880
|
+
request = bigtable_instance_admin.UpdateAppProfileRequest(request)
|
|
1881
|
+
|
|
1882
|
+
# If we have keyword arguments corresponding to fields on the
|
|
1883
|
+
# request, apply these.
|
|
1884
|
+
if app_profile is not None:
|
|
1885
|
+
request.app_profile = app_profile
|
|
1886
|
+
if update_mask is not None:
|
|
1887
|
+
request.update_mask = update_mask
|
|
1888
|
+
|
|
1889
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1890
|
+
# and friendly error handling.
|
|
1891
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1892
|
+
self._client._transport.update_app_profile
|
|
1893
|
+
]
|
|
1894
|
+
|
|
1895
|
+
# Certain fields should be provided within the metadata header;
|
|
1896
|
+
# add these here.
|
|
1897
|
+
metadata = tuple(metadata) + (
|
|
1898
|
+
gapic_v1.routing_header.to_grpc_metadata(
|
|
1899
|
+
(("app_profile.name", request.app_profile.name),)
|
|
1900
|
+
),
|
|
1901
|
+
)
|
|
1902
|
+
|
|
1903
|
+
# Validate the universe domain.
|
|
1904
|
+
self._client._validate_universe_domain()
|
|
1905
|
+
|
|
1906
|
+
# Send the request.
|
|
1907
|
+
response = await rpc(
|
|
1908
|
+
request,
|
|
1909
|
+
retry=retry,
|
|
1910
|
+
timeout=timeout,
|
|
1911
|
+
metadata=metadata,
|
|
1912
|
+
)
|
|
1913
|
+
|
|
1914
|
+
# Wrap the response in an operation future.
|
|
1915
|
+
response = operation_async.from_gapic(
|
|
1916
|
+
response,
|
|
1917
|
+
self._client._transport.operations_client,
|
|
1918
|
+
instance.AppProfile,
|
|
1919
|
+
metadata_type=bigtable_instance_admin.UpdateAppProfileMetadata,
|
|
1920
|
+
)
|
|
1921
|
+
|
|
1922
|
+
# Done; return the response.
|
|
1923
|
+
return response
|
|
1924
|
+
|
|
1925
|
+
async def delete_app_profile(
|
|
1926
|
+
self,
|
|
1927
|
+
request: Optional[
|
|
1928
|
+
Union[bigtable_instance_admin.DeleteAppProfileRequest, dict]
|
|
1929
|
+
] = None,
|
|
1930
|
+
*,
|
|
1931
|
+
name: Optional[str] = None,
|
|
1932
|
+
ignore_warnings: Optional[bool] = None,
|
|
1933
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1934
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
1935
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1936
|
+
) -> None:
|
|
1937
|
+
r"""Deletes an app profile from an instance.
|
|
1938
|
+
|
|
1939
|
+
Args:
|
|
1940
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteAppProfileRequest, dict]]):
|
|
1941
|
+
The request object. Request message for
|
|
1942
|
+
BigtableInstanceAdmin.DeleteAppProfile.
|
|
1943
|
+
name (:class:`str`):
|
|
1944
|
+
Required. The unique name of the app profile to be
|
|
1945
|
+
deleted. Values are of the form
|
|
1946
|
+
``projects/{project}/instances/{instance}/appProfiles/{app_profile}``.
|
|
1947
|
+
|
|
1948
|
+
This corresponds to the ``name`` field
|
|
1949
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1950
|
+
should not be set.
|
|
1951
|
+
ignore_warnings (:class:`bool`):
|
|
1952
|
+
Required. If true, ignore safety
|
|
1953
|
+
checks when deleting the app profile.
|
|
1954
|
+
|
|
1955
|
+
This corresponds to the ``ignore_warnings`` field
|
|
1956
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
1957
|
+
should not be set.
|
|
1958
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
1959
|
+
should be retried.
|
|
1960
|
+
timeout (float): The timeout for this request.
|
|
1961
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1962
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1963
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1964
|
+
be of type `bytes`.
|
|
1965
|
+
"""
|
|
1966
|
+
# Create or coerce a protobuf request object.
|
|
1967
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
1968
|
+
# gotten any keyword arguments that map to the request.
|
|
1969
|
+
flattened_params = [name, ignore_warnings]
|
|
1970
|
+
has_flattened_params = (
|
|
1971
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
1972
|
+
)
|
|
1973
|
+
if request is not None and has_flattened_params:
|
|
1974
|
+
raise ValueError(
|
|
1975
|
+
"If the `request` argument is set, then none of "
|
|
1976
|
+
"the individual field arguments should be set."
|
|
1977
|
+
)
|
|
1978
|
+
|
|
1979
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
1980
|
+
# there are no flattened fields), or create one.
|
|
1981
|
+
if not isinstance(request, bigtable_instance_admin.DeleteAppProfileRequest):
|
|
1982
|
+
request = bigtable_instance_admin.DeleteAppProfileRequest(request)
|
|
1983
|
+
|
|
1984
|
+
# If we have keyword arguments corresponding to fields on the
|
|
1985
|
+
# request, apply these.
|
|
1986
|
+
if name is not None:
|
|
1987
|
+
request.name = name
|
|
1988
|
+
if ignore_warnings is not None:
|
|
1989
|
+
request.ignore_warnings = ignore_warnings
|
|
1990
|
+
|
|
1991
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
1992
|
+
# and friendly error handling.
|
|
1993
|
+
rpc = self._client._transport._wrapped_methods[
|
|
1994
|
+
self._client._transport.delete_app_profile
|
|
1995
|
+
]
|
|
1996
|
+
|
|
1997
|
+
# Certain fields should be provided within the metadata header;
|
|
1998
|
+
# add these here.
|
|
1999
|
+
metadata = tuple(metadata) + (
|
|
2000
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
2001
|
+
)
|
|
2002
|
+
|
|
2003
|
+
# Validate the universe domain.
|
|
2004
|
+
self._client._validate_universe_domain()
|
|
2005
|
+
|
|
2006
|
+
# Send the request.
|
|
2007
|
+
await rpc(
|
|
2008
|
+
request,
|
|
2009
|
+
retry=retry,
|
|
2010
|
+
timeout=timeout,
|
|
2011
|
+
metadata=metadata,
|
|
2012
|
+
)
|
|
2013
|
+
|
|
2014
|
+
async def get_iam_policy(
|
|
2015
|
+
self,
|
|
2016
|
+
request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None,
|
|
2017
|
+
*,
|
|
2018
|
+
resource: Optional[str] = None,
|
|
2019
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2020
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
2021
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2022
|
+
) -> policy_pb2.Policy:
|
|
2023
|
+
r"""Gets the access control policy for an instance
|
|
2024
|
+
resource. Returns an empty policy if an instance exists
|
|
2025
|
+
but does not have a policy set.
|
|
2026
|
+
|
|
2027
|
+
Args:
|
|
2028
|
+
request (Optional[Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]]):
|
|
2029
|
+
The request object. Request message for ``GetIamPolicy`` method.
|
|
2030
|
+
resource (:class:`str`):
|
|
2031
|
+
REQUIRED: The resource for which the
|
|
2032
|
+
policy is being requested. See the
|
|
2033
|
+
operation documentation for the
|
|
2034
|
+
appropriate value for this field.
|
|
2035
|
+
|
|
2036
|
+
This corresponds to the ``resource`` field
|
|
2037
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2038
|
+
should not be set.
|
|
2039
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
2040
|
+
should be retried.
|
|
2041
|
+
timeout (float): The timeout for this request.
|
|
2042
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2043
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2044
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2045
|
+
be of type `bytes`.
|
|
2046
|
+
|
|
2047
|
+
Returns:
|
|
2048
|
+
google.iam.v1.policy_pb2.Policy:
|
|
2049
|
+
An Identity and Access Management (IAM) policy, which specifies access
|
|
2050
|
+
controls for Google Cloud resources.
|
|
2051
|
+
|
|
2052
|
+
A Policy is a collection of bindings. A binding binds
|
|
2053
|
+
one or more members, or principals, to a single role.
|
|
2054
|
+
Principals can be user accounts, service accounts,
|
|
2055
|
+
Google groups, and domains (such as G Suite). A role
|
|
2056
|
+
is a named list of permissions; each role can be an
|
|
2057
|
+
IAM predefined role or a user-created custom role.
|
|
2058
|
+
|
|
2059
|
+
For some types of Google Cloud resources, a binding
|
|
2060
|
+
can also specify a condition, which is a logical
|
|
2061
|
+
expression that allows access to a resource only if
|
|
2062
|
+
the expression evaluates to true. A condition can add
|
|
2063
|
+
constraints based on attributes of the request, the
|
|
2064
|
+
resource, or both. To learn which resources support
|
|
2065
|
+
conditions in their IAM policies, see the [IAM
|
|
2066
|
+
documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies).
|
|
2067
|
+
|
|
2068
|
+
**JSON example:**
|
|
2069
|
+
|
|
2070
|
+
: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 }`\ \`
|
|
2071
|
+
|
|
2072
|
+
**YAML example:**
|
|
2073
|
+
|
|
2074
|
+
: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`\ \`
|
|
2075
|
+
|
|
2076
|
+
For a description of IAM and its features, see the
|
|
2077
|
+
[IAM
|
|
2078
|
+
documentation](\ https://cloud.google.com/iam/docs/).
|
|
2079
|
+
|
|
2080
|
+
"""
|
|
2081
|
+
# Create or coerce a protobuf request object.
|
|
2082
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
2083
|
+
# gotten any keyword arguments that map to the request.
|
|
2084
|
+
flattened_params = [resource]
|
|
2085
|
+
has_flattened_params = (
|
|
2086
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
2087
|
+
)
|
|
2088
|
+
if request is not None and has_flattened_params:
|
|
2089
|
+
raise ValueError(
|
|
2090
|
+
"If the `request` argument is set, then none of "
|
|
2091
|
+
"the individual field arguments should be set."
|
|
2092
|
+
)
|
|
2093
|
+
|
|
2094
|
+
# - The request isn't a proto-plus wrapped type,
|
|
2095
|
+
# so it must be constructed via keyword expansion.
|
|
2096
|
+
if isinstance(request, dict):
|
|
2097
|
+
request = iam_policy_pb2.GetIamPolicyRequest(**request)
|
|
2098
|
+
elif not request:
|
|
2099
|
+
request = iam_policy_pb2.GetIamPolicyRequest(resource=resource)
|
|
2100
|
+
|
|
2101
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
2102
|
+
# and friendly error handling.
|
|
2103
|
+
rpc = self._client._transport._wrapped_methods[
|
|
2104
|
+
self._client._transport.get_iam_policy
|
|
2105
|
+
]
|
|
2106
|
+
|
|
2107
|
+
# Certain fields should be provided within the metadata header;
|
|
2108
|
+
# add these here.
|
|
2109
|
+
metadata = tuple(metadata) + (
|
|
2110
|
+
gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)),
|
|
2111
|
+
)
|
|
2112
|
+
|
|
2113
|
+
# Validate the universe domain.
|
|
2114
|
+
self._client._validate_universe_domain()
|
|
2115
|
+
|
|
2116
|
+
# Send the request.
|
|
2117
|
+
response = await rpc(
|
|
2118
|
+
request,
|
|
2119
|
+
retry=retry,
|
|
2120
|
+
timeout=timeout,
|
|
2121
|
+
metadata=metadata,
|
|
2122
|
+
)
|
|
2123
|
+
|
|
2124
|
+
# Done; return the response.
|
|
2125
|
+
return response
|
|
2126
|
+
|
|
2127
|
+
async def set_iam_policy(
|
|
2128
|
+
self,
|
|
2129
|
+
request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None,
|
|
2130
|
+
*,
|
|
2131
|
+
resource: Optional[str] = None,
|
|
2132
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2133
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
2134
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2135
|
+
) -> policy_pb2.Policy:
|
|
2136
|
+
r"""Sets the access control policy on an instance
|
|
2137
|
+
resource. Replaces any existing policy.
|
|
2138
|
+
|
|
2139
|
+
Args:
|
|
2140
|
+
request (Optional[Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]]):
|
|
2141
|
+
The request object. Request message for ``SetIamPolicy`` method.
|
|
2142
|
+
resource (:class:`str`):
|
|
2143
|
+
REQUIRED: The resource for which the
|
|
2144
|
+
policy is being specified. See the
|
|
2145
|
+
operation documentation for the
|
|
2146
|
+
appropriate value for this field.
|
|
2147
|
+
|
|
2148
|
+
This corresponds to the ``resource`` field
|
|
2149
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2150
|
+
should not be set.
|
|
2151
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
2152
|
+
should be retried.
|
|
2153
|
+
timeout (float): The timeout for this request.
|
|
2154
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2155
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2156
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2157
|
+
be of type `bytes`.
|
|
2158
|
+
|
|
2159
|
+
Returns:
|
|
2160
|
+
google.iam.v1.policy_pb2.Policy:
|
|
2161
|
+
An Identity and Access Management (IAM) policy, which specifies access
|
|
2162
|
+
controls for Google Cloud resources.
|
|
2163
|
+
|
|
2164
|
+
A Policy is a collection of bindings. A binding binds
|
|
2165
|
+
one or more members, or principals, to a single role.
|
|
2166
|
+
Principals can be user accounts, service accounts,
|
|
2167
|
+
Google groups, and domains (such as G Suite). A role
|
|
2168
|
+
is a named list of permissions; each role can be an
|
|
2169
|
+
IAM predefined role or a user-created custom role.
|
|
2170
|
+
|
|
2171
|
+
For some types of Google Cloud resources, a binding
|
|
2172
|
+
can also specify a condition, which is a logical
|
|
2173
|
+
expression that allows access to a resource only if
|
|
2174
|
+
the expression evaluates to true. A condition can add
|
|
2175
|
+
constraints based on attributes of the request, the
|
|
2176
|
+
resource, or both. To learn which resources support
|
|
2177
|
+
conditions in their IAM policies, see the [IAM
|
|
2178
|
+
documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies).
|
|
2179
|
+
|
|
2180
|
+
**JSON example:**
|
|
2181
|
+
|
|
2182
|
+
: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 }`\ \`
|
|
2183
|
+
|
|
2184
|
+
**YAML example:**
|
|
2185
|
+
|
|
2186
|
+
: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`\ \`
|
|
2187
|
+
|
|
2188
|
+
For a description of IAM and its features, see the
|
|
2189
|
+
[IAM
|
|
2190
|
+
documentation](\ https://cloud.google.com/iam/docs/).
|
|
2191
|
+
|
|
2192
|
+
"""
|
|
2193
|
+
# Create or coerce a protobuf request object.
|
|
2194
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
2195
|
+
# gotten any keyword arguments that map to the request.
|
|
2196
|
+
flattened_params = [resource]
|
|
2197
|
+
has_flattened_params = (
|
|
2198
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
2199
|
+
)
|
|
2200
|
+
if request is not None and has_flattened_params:
|
|
2201
|
+
raise ValueError(
|
|
2202
|
+
"If the `request` argument is set, then none of "
|
|
2203
|
+
"the individual field arguments should be set."
|
|
2204
|
+
)
|
|
2205
|
+
|
|
2206
|
+
# - The request isn't a proto-plus wrapped type,
|
|
2207
|
+
# so it must be constructed via keyword expansion.
|
|
2208
|
+
if isinstance(request, dict):
|
|
2209
|
+
request = iam_policy_pb2.SetIamPolicyRequest(**request)
|
|
2210
|
+
elif not request:
|
|
2211
|
+
request = iam_policy_pb2.SetIamPolicyRequest(resource=resource)
|
|
2212
|
+
|
|
2213
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
2214
|
+
# and friendly error handling.
|
|
2215
|
+
rpc = self._client._transport._wrapped_methods[
|
|
2216
|
+
self._client._transport.set_iam_policy
|
|
2217
|
+
]
|
|
2218
|
+
|
|
2219
|
+
# Certain fields should be provided within the metadata header;
|
|
2220
|
+
# add these here.
|
|
2221
|
+
metadata = tuple(metadata) + (
|
|
2222
|
+
gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)),
|
|
2223
|
+
)
|
|
2224
|
+
|
|
2225
|
+
# Validate the universe domain.
|
|
2226
|
+
self._client._validate_universe_domain()
|
|
2227
|
+
|
|
2228
|
+
# Send the request.
|
|
2229
|
+
response = await rpc(
|
|
2230
|
+
request,
|
|
2231
|
+
retry=retry,
|
|
2232
|
+
timeout=timeout,
|
|
2233
|
+
metadata=metadata,
|
|
2234
|
+
)
|
|
2235
|
+
|
|
2236
|
+
# Done; return the response.
|
|
2237
|
+
return response
|
|
2238
|
+
|
|
2239
|
+
async def test_iam_permissions(
|
|
2240
|
+
self,
|
|
2241
|
+
request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None,
|
|
2242
|
+
*,
|
|
2243
|
+
resource: Optional[str] = None,
|
|
2244
|
+
permissions: Optional[MutableSequence[str]] = None,
|
|
2245
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2246
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
2247
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2248
|
+
) -> iam_policy_pb2.TestIamPermissionsResponse:
|
|
2249
|
+
r"""Returns permissions that the caller has on the
|
|
2250
|
+
specified instance resource.
|
|
2251
|
+
|
|
2252
|
+
Args:
|
|
2253
|
+
request (Optional[Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]]):
|
|
2254
|
+
The request object. Request message for ``TestIamPermissions`` method.
|
|
2255
|
+
resource (:class:`str`):
|
|
2256
|
+
REQUIRED: The resource for which the
|
|
2257
|
+
policy detail is being requested. See
|
|
2258
|
+
the operation documentation for the
|
|
2259
|
+
appropriate value for this field.
|
|
2260
|
+
|
|
2261
|
+
This corresponds to the ``resource`` field
|
|
2262
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2263
|
+
should not be set.
|
|
2264
|
+
permissions (:class:`MutableSequence[str]`):
|
|
2265
|
+
The set of permissions to check for the ``resource``.
|
|
2266
|
+
Permissions with wildcards (such as '*' or 'storage.*')
|
|
2267
|
+
are not allowed. For more information see `IAM
|
|
2268
|
+
Overview <https://cloud.google.com/iam/docs/overview#permissions>`__.
|
|
2269
|
+
|
|
2270
|
+
This corresponds to the ``permissions`` field
|
|
2271
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2272
|
+
should not be set.
|
|
2273
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
2274
|
+
should be retried.
|
|
2275
|
+
timeout (float): The timeout for this request.
|
|
2276
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2277
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2278
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2279
|
+
be of type `bytes`.
|
|
2280
|
+
|
|
2281
|
+
Returns:
|
|
2282
|
+
google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse:
|
|
2283
|
+
Response message for TestIamPermissions method.
|
|
2284
|
+
"""
|
|
2285
|
+
# Create or coerce a protobuf request object.
|
|
2286
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
2287
|
+
# gotten any keyword arguments that map to the request.
|
|
2288
|
+
flattened_params = [resource, permissions]
|
|
2289
|
+
has_flattened_params = (
|
|
2290
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
2291
|
+
)
|
|
2292
|
+
if request is not None and has_flattened_params:
|
|
2293
|
+
raise ValueError(
|
|
2294
|
+
"If the `request` argument is set, then none of "
|
|
2295
|
+
"the individual field arguments should be set."
|
|
2296
|
+
)
|
|
2297
|
+
|
|
2298
|
+
# - The request isn't a proto-plus wrapped type,
|
|
2299
|
+
# so it must be constructed via keyword expansion.
|
|
2300
|
+
if isinstance(request, dict):
|
|
2301
|
+
request = iam_policy_pb2.TestIamPermissionsRequest(**request)
|
|
2302
|
+
elif not request:
|
|
2303
|
+
request = iam_policy_pb2.TestIamPermissionsRequest(
|
|
2304
|
+
resource=resource, permissions=permissions
|
|
2305
|
+
)
|
|
2306
|
+
|
|
2307
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
2308
|
+
# and friendly error handling.
|
|
2309
|
+
rpc = self._client._transport._wrapped_methods[
|
|
2310
|
+
self._client._transport.test_iam_permissions
|
|
2311
|
+
]
|
|
2312
|
+
|
|
2313
|
+
# Certain fields should be provided within the metadata header;
|
|
2314
|
+
# add these here.
|
|
2315
|
+
metadata = tuple(metadata) + (
|
|
2316
|
+
gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)),
|
|
2317
|
+
)
|
|
2318
|
+
|
|
2319
|
+
# Validate the universe domain.
|
|
2320
|
+
self._client._validate_universe_domain()
|
|
2321
|
+
|
|
2322
|
+
# Send the request.
|
|
2323
|
+
response = await rpc(
|
|
2324
|
+
request,
|
|
2325
|
+
retry=retry,
|
|
2326
|
+
timeout=timeout,
|
|
2327
|
+
metadata=metadata,
|
|
2328
|
+
)
|
|
2329
|
+
|
|
2330
|
+
# Done; return the response.
|
|
2331
|
+
return response
|
|
2332
|
+
|
|
2333
|
+
async def list_hot_tablets(
|
|
2334
|
+
self,
|
|
2335
|
+
request: Optional[
|
|
2336
|
+
Union[bigtable_instance_admin.ListHotTabletsRequest, dict]
|
|
2337
|
+
] = None,
|
|
2338
|
+
*,
|
|
2339
|
+
parent: Optional[str] = None,
|
|
2340
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2341
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
2342
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2343
|
+
) -> pagers.ListHotTabletsAsyncPager:
|
|
2344
|
+
r"""Lists hot tablets in a cluster, within the time range
|
|
2345
|
+
provided. Hot tablets are ordered based on CPU usage.
|
|
2346
|
+
|
|
2347
|
+
Args:
|
|
2348
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListHotTabletsRequest, dict]]):
|
|
2349
|
+
The request object. Request message for
|
|
2350
|
+
BigtableInstanceAdmin.ListHotTablets.
|
|
2351
|
+
parent (:class:`str`):
|
|
2352
|
+
Required. The cluster name to list hot tablets. Value is
|
|
2353
|
+
in the following form:
|
|
2354
|
+
``projects/{project}/instances/{instance}/clusters/{cluster}``.
|
|
2355
|
+
|
|
2356
|
+
This corresponds to the ``parent`` field
|
|
2357
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2358
|
+
should not be set.
|
|
2359
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
2360
|
+
should be retried.
|
|
2361
|
+
timeout (float): The timeout for this request.
|
|
2362
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2363
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2364
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2365
|
+
be of type `bytes`.
|
|
2366
|
+
|
|
2367
|
+
Returns:
|
|
2368
|
+
google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListHotTabletsAsyncPager:
|
|
2369
|
+
Response message for
|
|
2370
|
+
BigtableInstanceAdmin.ListHotTablets.
|
|
2371
|
+
Iterating over this object will yield
|
|
2372
|
+
results and resolve additional pages
|
|
2373
|
+
automatically.
|
|
2374
|
+
|
|
2375
|
+
"""
|
|
2376
|
+
# Create or coerce a protobuf request object.
|
|
2377
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
2378
|
+
# gotten any keyword arguments that map to the request.
|
|
2379
|
+
flattened_params = [parent]
|
|
2380
|
+
has_flattened_params = (
|
|
2381
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
2382
|
+
)
|
|
2383
|
+
if request is not None and has_flattened_params:
|
|
2384
|
+
raise ValueError(
|
|
2385
|
+
"If the `request` argument is set, then none of "
|
|
2386
|
+
"the individual field arguments should be set."
|
|
2387
|
+
)
|
|
2388
|
+
|
|
2389
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
2390
|
+
# there are no flattened fields), or create one.
|
|
2391
|
+
if not isinstance(request, bigtable_instance_admin.ListHotTabletsRequest):
|
|
2392
|
+
request = bigtable_instance_admin.ListHotTabletsRequest(request)
|
|
2393
|
+
|
|
2394
|
+
# If we have keyword arguments corresponding to fields on the
|
|
2395
|
+
# request, apply these.
|
|
2396
|
+
if parent is not None:
|
|
2397
|
+
request.parent = parent
|
|
2398
|
+
|
|
2399
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
2400
|
+
# and friendly error handling.
|
|
2401
|
+
rpc = self._client._transport._wrapped_methods[
|
|
2402
|
+
self._client._transport.list_hot_tablets
|
|
2403
|
+
]
|
|
2404
|
+
|
|
2405
|
+
# Certain fields should be provided within the metadata header;
|
|
2406
|
+
# add these here.
|
|
2407
|
+
metadata = tuple(metadata) + (
|
|
2408
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
2409
|
+
)
|
|
2410
|
+
|
|
2411
|
+
# Validate the universe domain.
|
|
2412
|
+
self._client._validate_universe_domain()
|
|
2413
|
+
|
|
2414
|
+
# Send the request.
|
|
2415
|
+
response = await rpc(
|
|
2416
|
+
request,
|
|
2417
|
+
retry=retry,
|
|
2418
|
+
timeout=timeout,
|
|
2419
|
+
metadata=metadata,
|
|
2420
|
+
)
|
|
2421
|
+
|
|
2422
|
+
# This method is paged; wrap the response in a pager, which provides
|
|
2423
|
+
# an `__aiter__` convenience method.
|
|
2424
|
+
response = pagers.ListHotTabletsAsyncPager(
|
|
2425
|
+
method=rpc,
|
|
2426
|
+
request=request,
|
|
2427
|
+
response=response,
|
|
2428
|
+
retry=retry,
|
|
2429
|
+
timeout=timeout,
|
|
2430
|
+
metadata=metadata,
|
|
2431
|
+
)
|
|
2432
|
+
|
|
2433
|
+
# Done; return the response.
|
|
2434
|
+
return response
|
|
2435
|
+
|
|
2436
|
+
async def create_logical_view(
|
|
2437
|
+
self,
|
|
2438
|
+
request: Optional[
|
|
2439
|
+
Union[bigtable_instance_admin.CreateLogicalViewRequest, dict]
|
|
2440
|
+
] = None,
|
|
2441
|
+
*,
|
|
2442
|
+
parent: Optional[str] = None,
|
|
2443
|
+
logical_view: Optional[instance.LogicalView] = None,
|
|
2444
|
+
logical_view_id: Optional[str] = None,
|
|
2445
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2446
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
2447
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2448
|
+
) -> operation_async.AsyncOperation:
|
|
2449
|
+
r"""Creates a logical view within an instance.
|
|
2450
|
+
|
|
2451
|
+
Args:
|
|
2452
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateLogicalViewRequest, dict]]):
|
|
2453
|
+
The request object. Request message for
|
|
2454
|
+
BigtableInstanceAdmin.CreateLogicalView.
|
|
2455
|
+
parent (:class:`str`):
|
|
2456
|
+
Required. The parent instance where this logical view
|
|
2457
|
+
will be created. Format:
|
|
2458
|
+
``projects/{project}/instances/{instance}``.
|
|
2459
|
+
|
|
2460
|
+
This corresponds to the ``parent`` field
|
|
2461
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2462
|
+
should not be set.
|
|
2463
|
+
logical_view (:class:`google.cloud.bigtable_admin_v2.types.LogicalView`):
|
|
2464
|
+
Required. The logical view to create.
|
|
2465
|
+
This corresponds to the ``logical_view`` field
|
|
2466
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2467
|
+
should not be set.
|
|
2468
|
+
logical_view_id (:class:`str`):
|
|
2469
|
+
Required. The ID to use for the
|
|
2470
|
+
logical view, which will become the
|
|
2471
|
+
final component of the logical view's
|
|
2472
|
+
resource name.
|
|
2473
|
+
|
|
2474
|
+
This corresponds to the ``logical_view_id`` field
|
|
2475
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2476
|
+
should not be set.
|
|
2477
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
2478
|
+
should be retried.
|
|
2479
|
+
timeout (float): The timeout for this request.
|
|
2480
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2481
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2482
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2483
|
+
be of type `bytes`.
|
|
2484
|
+
|
|
2485
|
+
Returns:
|
|
2486
|
+
google.api_core.operation_async.AsyncOperation:
|
|
2487
|
+
An object representing a long-running operation.
|
|
2488
|
+
|
|
2489
|
+
The result type for the operation will be
|
|
2490
|
+
:class:`google.cloud.bigtable_admin_v2.types.LogicalView`
|
|
2491
|
+
A SQL logical view object that can be referenced in SQL
|
|
2492
|
+
queries.
|
|
2493
|
+
|
|
2494
|
+
"""
|
|
2495
|
+
# Create or coerce a protobuf request object.
|
|
2496
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
2497
|
+
# gotten any keyword arguments that map to the request.
|
|
2498
|
+
flattened_params = [parent, logical_view, logical_view_id]
|
|
2499
|
+
has_flattened_params = (
|
|
2500
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
2501
|
+
)
|
|
2502
|
+
if request is not None and has_flattened_params:
|
|
2503
|
+
raise ValueError(
|
|
2504
|
+
"If the `request` argument is set, then none of "
|
|
2505
|
+
"the individual field arguments should be set."
|
|
2506
|
+
)
|
|
2507
|
+
|
|
2508
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
2509
|
+
# there are no flattened fields), or create one.
|
|
2510
|
+
if not isinstance(request, bigtable_instance_admin.CreateLogicalViewRequest):
|
|
2511
|
+
request = bigtable_instance_admin.CreateLogicalViewRequest(request)
|
|
2512
|
+
|
|
2513
|
+
# If we have keyword arguments corresponding to fields on the
|
|
2514
|
+
# request, apply these.
|
|
2515
|
+
if parent is not None:
|
|
2516
|
+
request.parent = parent
|
|
2517
|
+
if logical_view is not None:
|
|
2518
|
+
request.logical_view = logical_view
|
|
2519
|
+
if logical_view_id is not None:
|
|
2520
|
+
request.logical_view_id = logical_view_id
|
|
2521
|
+
|
|
2522
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
2523
|
+
# and friendly error handling.
|
|
2524
|
+
rpc = self._client._transport._wrapped_methods[
|
|
2525
|
+
self._client._transport.create_logical_view
|
|
2526
|
+
]
|
|
2527
|
+
|
|
2528
|
+
# Certain fields should be provided within the metadata header;
|
|
2529
|
+
# add these here.
|
|
2530
|
+
metadata = tuple(metadata) + (
|
|
2531
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
2532
|
+
)
|
|
2533
|
+
|
|
2534
|
+
# Validate the universe domain.
|
|
2535
|
+
self._client._validate_universe_domain()
|
|
2536
|
+
|
|
2537
|
+
# Send the request.
|
|
2538
|
+
response = await rpc(
|
|
2539
|
+
request,
|
|
2540
|
+
retry=retry,
|
|
2541
|
+
timeout=timeout,
|
|
2542
|
+
metadata=metadata,
|
|
2543
|
+
)
|
|
2544
|
+
|
|
2545
|
+
# Wrap the response in an operation future.
|
|
2546
|
+
response = operation_async.from_gapic(
|
|
2547
|
+
response,
|
|
2548
|
+
self._client._transport.operations_client,
|
|
2549
|
+
instance.LogicalView,
|
|
2550
|
+
metadata_type=bigtable_instance_admin.CreateLogicalViewMetadata,
|
|
2551
|
+
)
|
|
2552
|
+
|
|
2553
|
+
# Done; return the response.
|
|
2554
|
+
return response
|
|
2555
|
+
|
|
2556
|
+
async def get_logical_view(
|
|
2557
|
+
self,
|
|
2558
|
+
request: Optional[
|
|
2559
|
+
Union[bigtable_instance_admin.GetLogicalViewRequest, dict]
|
|
2560
|
+
] = None,
|
|
2561
|
+
*,
|
|
2562
|
+
name: Optional[str] = None,
|
|
2563
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2564
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
2565
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2566
|
+
) -> instance.LogicalView:
|
|
2567
|
+
r"""Gets information about a logical view.
|
|
2568
|
+
|
|
2569
|
+
Args:
|
|
2570
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetLogicalViewRequest, dict]]):
|
|
2571
|
+
The request object. Request message for
|
|
2572
|
+
BigtableInstanceAdmin.GetLogicalView.
|
|
2573
|
+
name (:class:`str`):
|
|
2574
|
+
Required. The unique name of the requested logical view.
|
|
2575
|
+
Values are of the form
|
|
2576
|
+
``projects/{project}/instances/{instance}/logicalViews/{logical_view}``.
|
|
2577
|
+
|
|
2578
|
+
This corresponds to the ``name`` field
|
|
2579
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2580
|
+
should not be set.
|
|
2581
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
2582
|
+
should be retried.
|
|
2583
|
+
timeout (float): The timeout for this request.
|
|
2584
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2585
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2586
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2587
|
+
be of type `bytes`.
|
|
2588
|
+
|
|
2589
|
+
Returns:
|
|
2590
|
+
google.cloud.bigtable_admin_v2.types.LogicalView:
|
|
2591
|
+
A SQL logical view object that can be
|
|
2592
|
+
referenced in SQL queries.
|
|
2593
|
+
|
|
2594
|
+
"""
|
|
2595
|
+
# Create or coerce a protobuf request object.
|
|
2596
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
2597
|
+
# gotten any keyword arguments that map to the request.
|
|
2598
|
+
flattened_params = [name]
|
|
2599
|
+
has_flattened_params = (
|
|
2600
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
2601
|
+
)
|
|
2602
|
+
if request is not None and has_flattened_params:
|
|
2603
|
+
raise ValueError(
|
|
2604
|
+
"If the `request` argument is set, then none of "
|
|
2605
|
+
"the individual field arguments should be set."
|
|
2606
|
+
)
|
|
2607
|
+
|
|
2608
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
2609
|
+
# there are no flattened fields), or create one.
|
|
2610
|
+
if not isinstance(request, bigtable_instance_admin.GetLogicalViewRequest):
|
|
2611
|
+
request = bigtable_instance_admin.GetLogicalViewRequest(request)
|
|
2612
|
+
|
|
2613
|
+
# If we have keyword arguments corresponding to fields on the
|
|
2614
|
+
# request, apply these.
|
|
2615
|
+
if name is not None:
|
|
2616
|
+
request.name = name
|
|
2617
|
+
|
|
2618
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
2619
|
+
# and friendly error handling.
|
|
2620
|
+
rpc = self._client._transport._wrapped_methods[
|
|
2621
|
+
self._client._transport.get_logical_view
|
|
2622
|
+
]
|
|
2623
|
+
|
|
2624
|
+
# Certain fields should be provided within the metadata header;
|
|
2625
|
+
# add these here.
|
|
2626
|
+
metadata = tuple(metadata) + (
|
|
2627
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
2628
|
+
)
|
|
2629
|
+
|
|
2630
|
+
# Validate the universe domain.
|
|
2631
|
+
self._client._validate_universe_domain()
|
|
2632
|
+
|
|
2633
|
+
# Send the request.
|
|
2634
|
+
response = await rpc(
|
|
2635
|
+
request,
|
|
2636
|
+
retry=retry,
|
|
2637
|
+
timeout=timeout,
|
|
2638
|
+
metadata=metadata,
|
|
2639
|
+
)
|
|
2640
|
+
|
|
2641
|
+
# Done; return the response.
|
|
2642
|
+
return response
|
|
2643
|
+
|
|
2644
|
+
async def list_logical_views(
|
|
2645
|
+
self,
|
|
2646
|
+
request: Optional[
|
|
2647
|
+
Union[bigtable_instance_admin.ListLogicalViewsRequest, dict]
|
|
2648
|
+
] = None,
|
|
2649
|
+
*,
|
|
2650
|
+
parent: Optional[str] = None,
|
|
2651
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2652
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
2653
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2654
|
+
) -> pagers.ListLogicalViewsAsyncPager:
|
|
2655
|
+
r"""Lists information about logical views in an instance.
|
|
2656
|
+
|
|
2657
|
+
Args:
|
|
2658
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListLogicalViewsRequest, dict]]):
|
|
2659
|
+
The request object. Request message for
|
|
2660
|
+
BigtableInstanceAdmin.ListLogicalViews.
|
|
2661
|
+
parent (:class:`str`):
|
|
2662
|
+
Required. The unique name of the instance for which the
|
|
2663
|
+
list of logical views is requested. Values are of the
|
|
2664
|
+
form ``projects/{project}/instances/{instance}``.
|
|
2665
|
+
|
|
2666
|
+
This corresponds to the ``parent`` field
|
|
2667
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2668
|
+
should not be set.
|
|
2669
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
2670
|
+
should be retried.
|
|
2671
|
+
timeout (float): The timeout for this request.
|
|
2672
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2673
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2674
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2675
|
+
be of type `bytes`.
|
|
2676
|
+
|
|
2677
|
+
Returns:
|
|
2678
|
+
google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListLogicalViewsAsyncPager:
|
|
2679
|
+
Response message for
|
|
2680
|
+
BigtableInstanceAdmin.ListLogicalViews.
|
|
2681
|
+
Iterating over this object will yield
|
|
2682
|
+
results and resolve additional pages
|
|
2683
|
+
automatically.
|
|
2684
|
+
|
|
2685
|
+
"""
|
|
2686
|
+
# Create or coerce a protobuf request object.
|
|
2687
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
2688
|
+
# gotten any keyword arguments that map to the request.
|
|
2689
|
+
flattened_params = [parent]
|
|
2690
|
+
has_flattened_params = (
|
|
2691
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
2692
|
+
)
|
|
2693
|
+
if request is not None and has_flattened_params:
|
|
2694
|
+
raise ValueError(
|
|
2695
|
+
"If the `request` argument is set, then none of "
|
|
2696
|
+
"the individual field arguments should be set."
|
|
2697
|
+
)
|
|
2698
|
+
|
|
2699
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
2700
|
+
# there are no flattened fields), or create one.
|
|
2701
|
+
if not isinstance(request, bigtable_instance_admin.ListLogicalViewsRequest):
|
|
2702
|
+
request = bigtable_instance_admin.ListLogicalViewsRequest(request)
|
|
2703
|
+
|
|
2704
|
+
# If we have keyword arguments corresponding to fields on the
|
|
2705
|
+
# request, apply these.
|
|
2706
|
+
if parent is not None:
|
|
2707
|
+
request.parent = parent
|
|
2708
|
+
|
|
2709
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
2710
|
+
# and friendly error handling.
|
|
2711
|
+
rpc = self._client._transport._wrapped_methods[
|
|
2712
|
+
self._client._transport.list_logical_views
|
|
2713
|
+
]
|
|
2714
|
+
|
|
2715
|
+
# Certain fields should be provided within the metadata header;
|
|
2716
|
+
# add these here.
|
|
2717
|
+
metadata = tuple(metadata) + (
|
|
2718
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
2719
|
+
)
|
|
2720
|
+
|
|
2721
|
+
# Validate the universe domain.
|
|
2722
|
+
self._client._validate_universe_domain()
|
|
2723
|
+
|
|
2724
|
+
# Send the request.
|
|
2725
|
+
response = await rpc(
|
|
2726
|
+
request,
|
|
2727
|
+
retry=retry,
|
|
2728
|
+
timeout=timeout,
|
|
2729
|
+
metadata=metadata,
|
|
2730
|
+
)
|
|
2731
|
+
|
|
2732
|
+
# This method is paged; wrap the response in a pager, which provides
|
|
2733
|
+
# an `__aiter__` convenience method.
|
|
2734
|
+
response = pagers.ListLogicalViewsAsyncPager(
|
|
2735
|
+
method=rpc,
|
|
2736
|
+
request=request,
|
|
2737
|
+
response=response,
|
|
2738
|
+
retry=retry,
|
|
2739
|
+
timeout=timeout,
|
|
2740
|
+
metadata=metadata,
|
|
2741
|
+
)
|
|
2742
|
+
|
|
2743
|
+
# Done; return the response.
|
|
2744
|
+
return response
|
|
2745
|
+
|
|
2746
|
+
async def update_logical_view(
|
|
2747
|
+
self,
|
|
2748
|
+
request: Optional[
|
|
2749
|
+
Union[bigtable_instance_admin.UpdateLogicalViewRequest, dict]
|
|
2750
|
+
] = None,
|
|
2751
|
+
*,
|
|
2752
|
+
logical_view: Optional[instance.LogicalView] = None,
|
|
2753
|
+
update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
|
2754
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2755
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
2756
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2757
|
+
) -> operation_async.AsyncOperation:
|
|
2758
|
+
r"""Updates a logical view within an instance.
|
|
2759
|
+
|
|
2760
|
+
Args:
|
|
2761
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateLogicalViewRequest, dict]]):
|
|
2762
|
+
The request object. Request message for
|
|
2763
|
+
BigtableInstanceAdmin.UpdateLogicalView.
|
|
2764
|
+
logical_view (:class:`google.cloud.bigtable_admin_v2.types.LogicalView`):
|
|
2765
|
+
Required. The logical view to update.
|
|
2766
|
+
|
|
2767
|
+
The logical view's ``name`` field is used to identify
|
|
2768
|
+
the view to update. Format:
|
|
2769
|
+
``projects/{project}/instances/{instance}/logicalViews/{logical_view}``.
|
|
2770
|
+
|
|
2771
|
+
This corresponds to the ``logical_view`` field
|
|
2772
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2773
|
+
should not be set.
|
|
2774
|
+
update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
|
|
2775
|
+
Optional. The list of fields to
|
|
2776
|
+
update.
|
|
2777
|
+
|
|
2778
|
+
This corresponds to the ``update_mask`` field
|
|
2779
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2780
|
+
should not be set.
|
|
2781
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
2782
|
+
should be retried.
|
|
2783
|
+
timeout (float): The timeout for this request.
|
|
2784
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2785
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2786
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2787
|
+
be of type `bytes`.
|
|
2788
|
+
|
|
2789
|
+
Returns:
|
|
2790
|
+
google.api_core.operation_async.AsyncOperation:
|
|
2791
|
+
An object representing a long-running operation.
|
|
2792
|
+
|
|
2793
|
+
The result type for the operation will be
|
|
2794
|
+
:class:`google.cloud.bigtable_admin_v2.types.LogicalView`
|
|
2795
|
+
A SQL logical view object that can be referenced in SQL
|
|
2796
|
+
queries.
|
|
2797
|
+
|
|
2798
|
+
"""
|
|
2799
|
+
# Create or coerce a protobuf request object.
|
|
2800
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
2801
|
+
# gotten any keyword arguments that map to the request.
|
|
2802
|
+
flattened_params = [logical_view, update_mask]
|
|
2803
|
+
has_flattened_params = (
|
|
2804
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
2805
|
+
)
|
|
2806
|
+
if request is not None and has_flattened_params:
|
|
2807
|
+
raise ValueError(
|
|
2808
|
+
"If the `request` argument is set, then none of "
|
|
2809
|
+
"the individual field arguments should be set."
|
|
2810
|
+
)
|
|
2811
|
+
|
|
2812
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
2813
|
+
# there are no flattened fields), or create one.
|
|
2814
|
+
if not isinstance(request, bigtable_instance_admin.UpdateLogicalViewRequest):
|
|
2815
|
+
request = bigtable_instance_admin.UpdateLogicalViewRequest(request)
|
|
2816
|
+
|
|
2817
|
+
# If we have keyword arguments corresponding to fields on the
|
|
2818
|
+
# request, apply these.
|
|
2819
|
+
if logical_view is not None:
|
|
2820
|
+
request.logical_view = logical_view
|
|
2821
|
+
if update_mask is not None:
|
|
2822
|
+
request.update_mask = update_mask
|
|
2823
|
+
|
|
2824
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
2825
|
+
# and friendly error handling.
|
|
2826
|
+
rpc = self._client._transport._wrapped_methods[
|
|
2827
|
+
self._client._transport.update_logical_view
|
|
2828
|
+
]
|
|
2829
|
+
|
|
2830
|
+
# Certain fields should be provided within the metadata header;
|
|
2831
|
+
# add these here.
|
|
2832
|
+
metadata = tuple(metadata) + (
|
|
2833
|
+
gapic_v1.routing_header.to_grpc_metadata(
|
|
2834
|
+
(("logical_view.name", request.logical_view.name),)
|
|
2835
|
+
),
|
|
2836
|
+
)
|
|
2837
|
+
|
|
2838
|
+
# Validate the universe domain.
|
|
2839
|
+
self._client._validate_universe_domain()
|
|
2840
|
+
|
|
2841
|
+
# Send the request.
|
|
2842
|
+
response = await rpc(
|
|
2843
|
+
request,
|
|
2844
|
+
retry=retry,
|
|
2845
|
+
timeout=timeout,
|
|
2846
|
+
metadata=metadata,
|
|
2847
|
+
)
|
|
2848
|
+
|
|
2849
|
+
# Wrap the response in an operation future.
|
|
2850
|
+
response = operation_async.from_gapic(
|
|
2851
|
+
response,
|
|
2852
|
+
self._client._transport.operations_client,
|
|
2853
|
+
instance.LogicalView,
|
|
2854
|
+
metadata_type=bigtable_instance_admin.UpdateLogicalViewMetadata,
|
|
2855
|
+
)
|
|
2856
|
+
|
|
2857
|
+
# Done; return the response.
|
|
2858
|
+
return response
|
|
2859
|
+
|
|
2860
|
+
async def delete_logical_view(
|
|
2861
|
+
self,
|
|
2862
|
+
request: Optional[
|
|
2863
|
+
Union[bigtable_instance_admin.DeleteLogicalViewRequest, dict]
|
|
2864
|
+
] = None,
|
|
2865
|
+
*,
|
|
2866
|
+
name: Optional[str] = None,
|
|
2867
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2868
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
2869
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2870
|
+
) -> None:
|
|
2871
|
+
r"""Deletes a logical view from an instance.
|
|
2872
|
+
|
|
2873
|
+
Args:
|
|
2874
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteLogicalViewRequest, dict]]):
|
|
2875
|
+
The request object. Request message for
|
|
2876
|
+
BigtableInstanceAdmin.DeleteLogicalView.
|
|
2877
|
+
name (:class:`str`):
|
|
2878
|
+
Required. The unique name of the logical view to be
|
|
2879
|
+
deleted. Format:
|
|
2880
|
+
``projects/{project}/instances/{instance}/logicalViews/{logical_view}``.
|
|
2881
|
+
|
|
2882
|
+
This corresponds to the ``name`` field
|
|
2883
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2884
|
+
should not be set.
|
|
2885
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
2886
|
+
should be retried.
|
|
2887
|
+
timeout (float): The timeout for this request.
|
|
2888
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2889
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2890
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2891
|
+
be of type `bytes`.
|
|
2892
|
+
"""
|
|
2893
|
+
# Create or coerce a protobuf request object.
|
|
2894
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
2895
|
+
# gotten any keyword arguments that map to the request.
|
|
2896
|
+
flattened_params = [name]
|
|
2897
|
+
has_flattened_params = (
|
|
2898
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
2899
|
+
)
|
|
2900
|
+
if request is not None and has_flattened_params:
|
|
2901
|
+
raise ValueError(
|
|
2902
|
+
"If the `request` argument is set, then none of "
|
|
2903
|
+
"the individual field arguments should be set."
|
|
2904
|
+
)
|
|
2905
|
+
|
|
2906
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
2907
|
+
# there are no flattened fields), or create one.
|
|
2908
|
+
if not isinstance(request, bigtable_instance_admin.DeleteLogicalViewRequest):
|
|
2909
|
+
request = bigtable_instance_admin.DeleteLogicalViewRequest(request)
|
|
2910
|
+
|
|
2911
|
+
# If we have keyword arguments corresponding to fields on the
|
|
2912
|
+
# request, apply these.
|
|
2913
|
+
if name is not None:
|
|
2914
|
+
request.name = name
|
|
2915
|
+
|
|
2916
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
2917
|
+
# and friendly error handling.
|
|
2918
|
+
rpc = self._client._transport._wrapped_methods[
|
|
2919
|
+
self._client._transport.delete_logical_view
|
|
2920
|
+
]
|
|
2921
|
+
|
|
2922
|
+
# Certain fields should be provided within the metadata header;
|
|
2923
|
+
# add these here.
|
|
2924
|
+
metadata = tuple(metadata) + (
|
|
2925
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
2926
|
+
)
|
|
2927
|
+
|
|
2928
|
+
# Validate the universe domain.
|
|
2929
|
+
self._client._validate_universe_domain()
|
|
2930
|
+
|
|
2931
|
+
# Send the request.
|
|
2932
|
+
await rpc(
|
|
2933
|
+
request,
|
|
2934
|
+
retry=retry,
|
|
2935
|
+
timeout=timeout,
|
|
2936
|
+
metadata=metadata,
|
|
2937
|
+
)
|
|
2938
|
+
|
|
2939
|
+
async def create_materialized_view(
|
|
2940
|
+
self,
|
|
2941
|
+
request: Optional[
|
|
2942
|
+
Union[bigtable_instance_admin.CreateMaterializedViewRequest, dict]
|
|
2943
|
+
] = None,
|
|
2944
|
+
*,
|
|
2945
|
+
parent: Optional[str] = None,
|
|
2946
|
+
materialized_view: Optional[instance.MaterializedView] = None,
|
|
2947
|
+
materialized_view_id: Optional[str] = None,
|
|
2948
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2949
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
2950
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2951
|
+
) -> operation_async.AsyncOperation:
|
|
2952
|
+
r"""Creates a materialized view within an instance.
|
|
2953
|
+
|
|
2954
|
+
Args:
|
|
2955
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateMaterializedViewRequest, dict]]):
|
|
2956
|
+
The request object. Request message for
|
|
2957
|
+
BigtableInstanceAdmin.CreateMaterializedView.
|
|
2958
|
+
parent (:class:`str`):
|
|
2959
|
+
Required. The parent instance where this materialized
|
|
2960
|
+
view will be created. Format:
|
|
2961
|
+
``projects/{project}/instances/{instance}``.
|
|
2962
|
+
|
|
2963
|
+
This corresponds to the ``parent`` field
|
|
2964
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2965
|
+
should not be set.
|
|
2966
|
+
materialized_view (:class:`google.cloud.bigtable_admin_v2.types.MaterializedView`):
|
|
2967
|
+
Required. The materialized view to
|
|
2968
|
+
create.
|
|
2969
|
+
|
|
2970
|
+
This corresponds to the ``materialized_view`` field
|
|
2971
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2972
|
+
should not be set.
|
|
2973
|
+
materialized_view_id (:class:`str`):
|
|
2974
|
+
Required. The ID to use for the
|
|
2975
|
+
materialized view, which will become the
|
|
2976
|
+
final component of the materialized
|
|
2977
|
+
view's resource name.
|
|
2978
|
+
|
|
2979
|
+
This corresponds to the ``materialized_view_id`` field
|
|
2980
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
2981
|
+
should not be set.
|
|
2982
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
2983
|
+
should be retried.
|
|
2984
|
+
timeout (float): The timeout for this request.
|
|
2985
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2986
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2987
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2988
|
+
be of type `bytes`.
|
|
2989
|
+
|
|
2990
|
+
Returns:
|
|
2991
|
+
google.api_core.operation_async.AsyncOperation:
|
|
2992
|
+
An object representing a long-running operation.
|
|
2993
|
+
|
|
2994
|
+
The result type for the operation will be
|
|
2995
|
+
:class:`google.cloud.bigtable_admin_v2.types.MaterializedView`
|
|
2996
|
+
A materialized view object that can be referenced in SQL
|
|
2997
|
+
queries.
|
|
2998
|
+
|
|
2999
|
+
"""
|
|
3000
|
+
# Create or coerce a protobuf request object.
|
|
3001
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
3002
|
+
# gotten any keyword arguments that map to the request.
|
|
3003
|
+
flattened_params = [parent, materialized_view, materialized_view_id]
|
|
3004
|
+
has_flattened_params = (
|
|
3005
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
3006
|
+
)
|
|
3007
|
+
if request is not None and has_flattened_params:
|
|
3008
|
+
raise ValueError(
|
|
3009
|
+
"If the `request` argument is set, then none of "
|
|
3010
|
+
"the individual field arguments should be set."
|
|
3011
|
+
)
|
|
3012
|
+
|
|
3013
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
3014
|
+
# there are no flattened fields), or create one.
|
|
3015
|
+
if not isinstance(
|
|
3016
|
+
request, bigtable_instance_admin.CreateMaterializedViewRequest
|
|
3017
|
+
):
|
|
3018
|
+
request = bigtable_instance_admin.CreateMaterializedViewRequest(request)
|
|
3019
|
+
|
|
3020
|
+
# If we have keyword arguments corresponding to fields on the
|
|
3021
|
+
# request, apply these.
|
|
3022
|
+
if parent is not None:
|
|
3023
|
+
request.parent = parent
|
|
3024
|
+
if materialized_view is not None:
|
|
3025
|
+
request.materialized_view = materialized_view
|
|
3026
|
+
if materialized_view_id is not None:
|
|
3027
|
+
request.materialized_view_id = materialized_view_id
|
|
3028
|
+
|
|
3029
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
3030
|
+
# and friendly error handling.
|
|
3031
|
+
rpc = self._client._transport._wrapped_methods[
|
|
3032
|
+
self._client._transport.create_materialized_view
|
|
3033
|
+
]
|
|
3034
|
+
|
|
3035
|
+
# Certain fields should be provided within the metadata header;
|
|
3036
|
+
# add these here.
|
|
3037
|
+
metadata = tuple(metadata) + (
|
|
3038
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
3039
|
+
)
|
|
3040
|
+
|
|
3041
|
+
# Validate the universe domain.
|
|
3042
|
+
self._client._validate_universe_domain()
|
|
3043
|
+
|
|
3044
|
+
# Send the request.
|
|
3045
|
+
response = await rpc(
|
|
3046
|
+
request,
|
|
3047
|
+
retry=retry,
|
|
3048
|
+
timeout=timeout,
|
|
3049
|
+
metadata=metadata,
|
|
3050
|
+
)
|
|
3051
|
+
|
|
3052
|
+
# Wrap the response in an operation future.
|
|
3053
|
+
response = operation_async.from_gapic(
|
|
3054
|
+
response,
|
|
3055
|
+
self._client._transport.operations_client,
|
|
3056
|
+
instance.MaterializedView,
|
|
3057
|
+
metadata_type=bigtable_instance_admin.CreateMaterializedViewMetadata,
|
|
3058
|
+
)
|
|
3059
|
+
|
|
3060
|
+
# Done; return the response.
|
|
3061
|
+
return response
|
|
3062
|
+
|
|
3063
|
+
async def get_materialized_view(
|
|
3064
|
+
self,
|
|
3065
|
+
request: Optional[
|
|
3066
|
+
Union[bigtable_instance_admin.GetMaterializedViewRequest, dict]
|
|
3067
|
+
] = None,
|
|
3068
|
+
*,
|
|
3069
|
+
name: Optional[str] = None,
|
|
3070
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
3071
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
3072
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
3073
|
+
) -> instance.MaterializedView:
|
|
3074
|
+
r"""Gets information about a materialized view.
|
|
3075
|
+
|
|
3076
|
+
Args:
|
|
3077
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetMaterializedViewRequest, dict]]):
|
|
3078
|
+
The request object. Request message for
|
|
3079
|
+
BigtableInstanceAdmin.GetMaterializedView.
|
|
3080
|
+
name (:class:`str`):
|
|
3081
|
+
Required. The unique name of the requested materialized
|
|
3082
|
+
view. Values are of the form
|
|
3083
|
+
``projects/{project}/instances/{instance}/materializedViews/{materialized_view}``.
|
|
3084
|
+
|
|
3085
|
+
This corresponds to the ``name`` field
|
|
3086
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
3087
|
+
should not be set.
|
|
3088
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
3089
|
+
should be retried.
|
|
3090
|
+
timeout (float): The timeout for this request.
|
|
3091
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
3092
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
3093
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
3094
|
+
be of type `bytes`.
|
|
3095
|
+
|
|
3096
|
+
Returns:
|
|
3097
|
+
google.cloud.bigtable_admin_v2.types.MaterializedView:
|
|
3098
|
+
A materialized view object that can
|
|
3099
|
+
be referenced in SQL queries.
|
|
3100
|
+
|
|
3101
|
+
"""
|
|
3102
|
+
# Create or coerce a protobuf request object.
|
|
3103
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
3104
|
+
# gotten any keyword arguments that map to the request.
|
|
3105
|
+
flattened_params = [name]
|
|
3106
|
+
has_flattened_params = (
|
|
3107
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
3108
|
+
)
|
|
3109
|
+
if request is not None and has_flattened_params:
|
|
3110
|
+
raise ValueError(
|
|
3111
|
+
"If the `request` argument is set, then none of "
|
|
3112
|
+
"the individual field arguments should be set."
|
|
3113
|
+
)
|
|
3114
|
+
|
|
3115
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
3116
|
+
# there are no flattened fields), or create one.
|
|
3117
|
+
if not isinstance(request, bigtable_instance_admin.GetMaterializedViewRequest):
|
|
3118
|
+
request = bigtable_instance_admin.GetMaterializedViewRequest(request)
|
|
3119
|
+
|
|
3120
|
+
# If we have keyword arguments corresponding to fields on the
|
|
3121
|
+
# request, apply these.
|
|
3122
|
+
if name is not None:
|
|
3123
|
+
request.name = name
|
|
3124
|
+
|
|
3125
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
3126
|
+
# and friendly error handling.
|
|
3127
|
+
rpc = self._client._transport._wrapped_methods[
|
|
3128
|
+
self._client._transport.get_materialized_view
|
|
3129
|
+
]
|
|
3130
|
+
|
|
3131
|
+
# Certain fields should be provided within the metadata header;
|
|
3132
|
+
# add these here.
|
|
3133
|
+
metadata = tuple(metadata) + (
|
|
3134
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
3135
|
+
)
|
|
3136
|
+
|
|
3137
|
+
# Validate the universe domain.
|
|
3138
|
+
self._client._validate_universe_domain()
|
|
3139
|
+
|
|
3140
|
+
# Send the request.
|
|
3141
|
+
response = await rpc(
|
|
3142
|
+
request,
|
|
3143
|
+
retry=retry,
|
|
3144
|
+
timeout=timeout,
|
|
3145
|
+
metadata=metadata,
|
|
3146
|
+
)
|
|
3147
|
+
|
|
3148
|
+
# Done; return the response.
|
|
3149
|
+
return response
|
|
3150
|
+
|
|
3151
|
+
async def list_materialized_views(
|
|
3152
|
+
self,
|
|
3153
|
+
request: Optional[
|
|
3154
|
+
Union[bigtable_instance_admin.ListMaterializedViewsRequest, dict]
|
|
3155
|
+
] = None,
|
|
3156
|
+
*,
|
|
3157
|
+
parent: Optional[str] = None,
|
|
3158
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
3159
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
3160
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
3161
|
+
) -> pagers.ListMaterializedViewsAsyncPager:
|
|
3162
|
+
r"""Lists information about materialized views in an
|
|
3163
|
+
instance.
|
|
3164
|
+
|
|
3165
|
+
Args:
|
|
3166
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListMaterializedViewsRequest, dict]]):
|
|
3167
|
+
The request object. Request message for
|
|
3168
|
+
BigtableInstanceAdmin.ListMaterializedViews.
|
|
3169
|
+
parent (:class:`str`):
|
|
3170
|
+
Required. The unique name of the instance for which the
|
|
3171
|
+
list of materialized views is requested. Values are of
|
|
3172
|
+
the form ``projects/{project}/instances/{instance}``.
|
|
3173
|
+
|
|
3174
|
+
This corresponds to the ``parent`` field
|
|
3175
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
3176
|
+
should not be set.
|
|
3177
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
3178
|
+
should be retried.
|
|
3179
|
+
timeout (float): The timeout for this request.
|
|
3180
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
3181
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
3182
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
3183
|
+
be of type `bytes`.
|
|
3184
|
+
|
|
3185
|
+
Returns:
|
|
3186
|
+
google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListMaterializedViewsAsyncPager:
|
|
3187
|
+
Response message for
|
|
3188
|
+
BigtableInstanceAdmin.ListMaterializedViews.
|
|
3189
|
+
Iterating over this object will yield
|
|
3190
|
+
results and resolve additional pages
|
|
3191
|
+
automatically.
|
|
3192
|
+
|
|
3193
|
+
"""
|
|
3194
|
+
# Create or coerce a protobuf request object.
|
|
3195
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
3196
|
+
# gotten any keyword arguments that map to the request.
|
|
3197
|
+
flattened_params = [parent]
|
|
3198
|
+
has_flattened_params = (
|
|
3199
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
3200
|
+
)
|
|
3201
|
+
if request is not None and has_flattened_params:
|
|
3202
|
+
raise ValueError(
|
|
3203
|
+
"If the `request` argument is set, then none of "
|
|
3204
|
+
"the individual field arguments should be set."
|
|
3205
|
+
)
|
|
3206
|
+
|
|
3207
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
3208
|
+
# there are no flattened fields), or create one.
|
|
3209
|
+
if not isinstance(
|
|
3210
|
+
request, bigtable_instance_admin.ListMaterializedViewsRequest
|
|
3211
|
+
):
|
|
3212
|
+
request = bigtable_instance_admin.ListMaterializedViewsRequest(request)
|
|
3213
|
+
|
|
3214
|
+
# If we have keyword arguments corresponding to fields on the
|
|
3215
|
+
# request, apply these.
|
|
3216
|
+
if parent is not None:
|
|
3217
|
+
request.parent = parent
|
|
3218
|
+
|
|
3219
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
3220
|
+
# and friendly error handling.
|
|
3221
|
+
rpc = self._client._transport._wrapped_methods[
|
|
3222
|
+
self._client._transport.list_materialized_views
|
|
3223
|
+
]
|
|
3224
|
+
|
|
3225
|
+
# Certain fields should be provided within the metadata header;
|
|
3226
|
+
# add these here.
|
|
3227
|
+
metadata = tuple(metadata) + (
|
|
3228
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
3229
|
+
)
|
|
3230
|
+
|
|
3231
|
+
# Validate the universe domain.
|
|
3232
|
+
self._client._validate_universe_domain()
|
|
3233
|
+
|
|
3234
|
+
# Send the request.
|
|
3235
|
+
response = await rpc(
|
|
3236
|
+
request,
|
|
3237
|
+
retry=retry,
|
|
3238
|
+
timeout=timeout,
|
|
3239
|
+
metadata=metadata,
|
|
3240
|
+
)
|
|
3241
|
+
|
|
3242
|
+
# This method is paged; wrap the response in a pager, which provides
|
|
3243
|
+
# an `__aiter__` convenience method.
|
|
3244
|
+
response = pagers.ListMaterializedViewsAsyncPager(
|
|
3245
|
+
method=rpc,
|
|
3246
|
+
request=request,
|
|
3247
|
+
response=response,
|
|
3248
|
+
retry=retry,
|
|
3249
|
+
timeout=timeout,
|
|
3250
|
+
metadata=metadata,
|
|
3251
|
+
)
|
|
3252
|
+
|
|
3253
|
+
# Done; return the response.
|
|
3254
|
+
return response
|
|
3255
|
+
|
|
3256
|
+
async def update_materialized_view(
|
|
3257
|
+
self,
|
|
3258
|
+
request: Optional[
|
|
3259
|
+
Union[bigtable_instance_admin.UpdateMaterializedViewRequest, dict]
|
|
3260
|
+
] = None,
|
|
3261
|
+
*,
|
|
3262
|
+
materialized_view: Optional[instance.MaterializedView] = None,
|
|
3263
|
+
update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
|
3264
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
3265
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
3266
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
3267
|
+
) -> operation_async.AsyncOperation:
|
|
3268
|
+
r"""Updates a materialized view within an instance.
|
|
3269
|
+
|
|
3270
|
+
Args:
|
|
3271
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateMaterializedViewRequest, dict]]):
|
|
3272
|
+
The request object. Request message for
|
|
3273
|
+
BigtableInstanceAdmin.UpdateMaterializedView.
|
|
3274
|
+
materialized_view (:class:`google.cloud.bigtable_admin_v2.types.MaterializedView`):
|
|
3275
|
+
Required. The materialized view to update.
|
|
3276
|
+
|
|
3277
|
+
The materialized view's ``name`` field is used to
|
|
3278
|
+
identify the view to update. Format:
|
|
3279
|
+
``projects/{project}/instances/{instance}/materializedViews/{materialized_view}``.
|
|
3280
|
+
|
|
3281
|
+
This corresponds to the ``materialized_view`` field
|
|
3282
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
3283
|
+
should not be set.
|
|
3284
|
+
update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
|
|
3285
|
+
Optional. The list of fields to
|
|
3286
|
+
update.
|
|
3287
|
+
|
|
3288
|
+
This corresponds to the ``update_mask`` field
|
|
3289
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
3290
|
+
should not be set.
|
|
3291
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
3292
|
+
should be retried.
|
|
3293
|
+
timeout (float): The timeout for this request.
|
|
3294
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
3295
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
3296
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
3297
|
+
be of type `bytes`.
|
|
3298
|
+
|
|
3299
|
+
Returns:
|
|
3300
|
+
google.api_core.operation_async.AsyncOperation:
|
|
3301
|
+
An object representing a long-running operation.
|
|
3302
|
+
|
|
3303
|
+
The result type for the operation will be
|
|
3304
|
+
:class:`google.cloud.bigtable_admin_v2.types.MaterializedView`
|
|
3305
|
+
A materialized view object that can be referenced in SQL
|
|
3306
|
+
queries.
|
|
3307
|
+
|
|
3308
|
+
"""
|
|
3309
|
+
# Create or coerce a protobuf request object.
|
|
3310
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
3311
|
+
# gotten any keyword arguments that map to the request.
|
|
3312
|
+
flattened_params = [materialized_view, update_mask]
|
|
3313
|
+
has_flattened_params = (
|
|
3314
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
3315
|
+
)
|
|
3316
|
+
if request is not None and has_flattened_params:
|
|
3317
|
+
raise ValueError(
|
|
3318
|
+
"If the `request` argument is set, then none of "
|
|
3319
|
+
"the individual field arguments should be set."
|
|
3320
|
+
)
|
|
3321
|
+
|
|
3322
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
3323
|
+
# there are no flattened fields), or create one.
|
|
3324
|
+
if not isinstance(
|
|
3325
|
+
request, bigtable_instance_admin.UpdateMaterializedViewRequest
|
|
3326
|
+
):
|
|
3327
|
+
request = bigtable_instance_admin.UpdateMaterializedViewRequest(request)
|
|
3328
|
+
|
|
3329
|
+
# If we have keyword arguments corresponding to fields on the
|
|
3330
|
+
# request, apply these.
|
|
3331
|
+
if materialized_view is not None:
|
|
3332
|
+
request.materialized_view = materialized_view
|
|
3333
|
+
if update_mask is not None:
|
|
3334
|
+
request.update_mask = update_mask
|
|
3335
|
+
|
|
3336
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
3337
|
+
# and friendly error handling.
|
|
3338
|
+
rpc = self._client._transport._wrapped_methods[
|
|
3339
|
+
self._client._transport.update_materialized_view
|
|
3340
|
+
]
|
|
3341
|
+
|
|
3342
|
+
# Certain fields should be provided within the metadata header;
|
|
3343
|
+
# add these here.
|
|
3344
|
+
metadata = tuple(metadata) + (
|
|
3345
|
+
gapic_v1.routing_header.to_grpc_metadata(
|
|
3346
|
+
(("materialized_view.name", request.materialized_view.name),)
|
|
3347
|
+
),
|
|
3348
|
+
)
|
|
3349
|
+
|
|
3350
|
+
# Validate the universe domain.
|
|
3351
|
+
self._client._validate_universe_domain()
|
|
3352
|
+
|
|
3353
|
+
# Send the request.
|
|
3354
|
+
response = await rpc(
|
|
3355
|
+
request,
|
|
3356
|
+
retry=retry,
|
|
3357
|
+
timeout=timeout,
|
|
3358
|
+
metadata=metadata,
|
|
3359
|
+
)
|
|
3360
|
+
|
|
3361
|
+
# Wrap the response in an operation future.
|
|
3362
|
+
response = operation_async.from_gapic(
|
|
3363
|
+
response,
|
|
3364
|
+
self._client._transport.operations_client,
|
|
3365
|
+
instance.MaterializedView,
|
|
3366
|
+
metadata_type=bigtable_instance_admin.UpdateMaterializedViewMetadata,
|
|
3367
|
+
)
|
|
3368
|
+
|
|
3369
|
+
# Done; return the response.
|
|
3370
|
+
return response
|
|
3371
|
+
|
|
3372
|
+
async def delete_materialized_view(
|
|
3373
|
+
self,
|
|
3374
|
+
request: Optional[
|
|
3375
|
+
Union[bigtable_instance_admin.DeleteMaterializedViewRequest, dict]
|
|
3376
|
+
] = None,
|
|
3377
|
+
*,
|
|
3378
|
+
name: Optional[str] = None,
|
|
3379
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
3380
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
3381
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
3382
|
+
) -> None:
|
|
3383
|
+
r"""Deletes a materialized view from an instance.
|
|
3384
|
+
|
|
3385
|
+
Args:
|
|
3386
|
+
request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteMaterializedViewRequest, dict]]):
|
|
3387
|
+
The request object. Request message for
|
|
3388
|
+
BigtableInstanceAdmin.DeleteMaterializedView.
|
|
3389
|
+
name (:class:`str`):
|
|
3390
|
+
Required. The unique name of the materialized view to be
|
|
3391
|
+
deleted. Format:
|
|
3392
|
+
``projects/{project}/instances/{instance}/materializedViews/{materialized_view}``.
|
|
3393
|
+
|
|
3394
|
+
This corresponds to the ``name`` field
|
|
3395
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
3396
|
+
should not be set.
|
|
3397
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
3398
|
+
should be retried.
|
|
3399
|
+
timeout (float): The timeout for this request.
|
|
3400
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
3401
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
3402
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
3403
|
+
be of type `bytes`.
|
|
3404
|
+
"""
|
|
3405
|
+
# Create or coerce a protobuf request object.
|
|
3406
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
3407
|
+
# gotten any keyword arguments that map to the request.
|
|
3408
|
+
flattened_params = [name]
|
|
3409
|
+
has_flattened_params = (
|
|
3410
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
3411
|
+
)
|
|
3412
|
+
if request is not None and has_flattened_params:
|
|
3413
|
+
raise ValueError(
|
|
3414
|
+
"If the `request` argument is set, then none of "
|
|
3415
|
+
"the individual field arguments should be set."
|
|
3416
|
+
)
|
|
3417
|
+
|
|
3418
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
3419
|
+
# there are no flattened fields), or create one.
|
|
3420
|
+
if not isinstance(
|
|
3421
|
+
request, bigtable_instance_admin.DeleteMaterializedViewRequest
|
|
3422
|
+
):
|
|
3423
|
+
request = bigtable_instance_admin.DeleteMaterializedViewRequest(request)
|
|
3424
|
+
|
|
3425
|
+
# If we have keyword arguments corresponding to fields on the
|
|
3426
|
+
# request, apply these.
|
|
3427
|
+
if name is not None:
|
|
3428
|
+
request.name = name
|
|
3429
|
+
|
|
3430
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
3431
|
+
# and friendly error handling.
|
|
3432
|
+
rpc = self._client._transport._wrapped_methods[
|
|
3433
|
+
self._client._transport.delete_materialized_view
|
|
3434
|
+
]
|
|
3435
|
+
|
|
3436
|
+
# Certain fields should be provided within the metadata header;
|
|
3437
|
+
# add these here.
|
|
3438
|
+
metadata = tuple(metadata) + (
|
|
3439
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
3440
|
+
)
|
|
3441
|
+
|
|
3442
|
+
# Validate the universe domain.
|
|
3443
|
+
self._client._validate_universe_domain()
|
|
3444
|
+
|
|
3445
|
+
# Send the request.
|
|
3446
|
+
await rpc(
|
|
3447
|
+
request,
|
|
3448
|
+
retry=retry,
|
|
3449
|
+
timeout=timeout,
|
|
3450
|
+
metadata=metadata,
|
|
3451
|
+
)
|
|
3452
|
+
|
|
3453
|
+
async def __aenter__(self) -> "BigtableInstanceAdminAsyncClient":
|
|
3454
|
+
return self
|
|
3455
|
+
|
|
3456
|
+
async def __aexit__(self, exc_type, exc, tb):
|
|
3457
|
+
await self.transport.close()
|
|
3458
|
+
|
|
3459
|
+
|
|
3460
|
+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
|
|
3461
|
+
gapic_version=package_version.__version__
|
|
3462
|
+
)
|
|
3463
|
+
|
|
3464
|
+
|
|
3465
|
+
__all__ = ("BigtableInstanceAdminAsyncClient",)
|