Skip to content

Commit 2faf01b

Browse files
feat: add support for ssl credentials; add throttled field to UpdateDatabaseDdlMetadata (#161)
* changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * chore: revert breaking docstrings and unneeded bigquery doc ignore Co-authored-by: larkee <[email protected]>
1 parent af5a3c6 commit 2faf01b

File tree

18 files changed

+201
-2
lines changed

18 files changed

+201
-2
lines changed

docs/spanner_admin_database_v1/types.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Types for Google Cloud Spanner Admin Database v1 API
33

44
.. automodule:: google.cloud.spanner_admin_database_v1.types
55
:members:
6+
:show-inheritance:

docs/spanner_admin_instance_v1/types.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Types for Google Cloud Spanner Admin Instance v1 API
33

44
.. automodule:: google.cloud.spanner_admin_instance_v1.types
55
:members:
6+
:show-inheritance:

docs/spanner_v1/types.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Types for Google Cloud Spanner v1 API
33

44
.. automodule:: google.cloud.spanner_v1.types
55
:members:
6+
:show-inheritance:

google/cloud/spanner_admin_database_v1/proto/spanner_database_admin.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ message UpdateDatabaseDdlMetadata {
514514
// succeeded so far, where `commit_timestamps[i]` is the commit
515515
// timestamp for the statement `statements[i]`.
516516
repeated google.protobuf.Timestamp commit_timestamps = 3;
517+
518+
// Output only. When true, indicates that the operation is throttled e.g
519+
// due to resource constraints. When resources become available the operation
520+
// will resume and this field will be false again.
521+
bool throttled = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
517522
}
518523

519524
// The request for [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase].

google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,16 @@ def __init__(
113113
google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
114114
and ``credentials_file`` are passed.
115115
"""
116+
self._ssl_channel_credentials = ssl_channel_credentials
117+
116118
if channel:
117119
# Sanity check: Ensure that channel and credentials are not both
118120
# provided.
119121
credentials = False
120122

121123
# If a channel was explicitly provided, set it.
122124
self._grpc_channel = channel
125+
self._ssl_channel_credentials = None
123126
elif api_mtls_endpoint:
124127
warnings.warn(
125128
"api_mtls_endpoint and client_cert_source are deprecated",
@@ -156,6 +159,7 @@ def __init__(
156159
scopes=scopes or self.AUTH_SCOPES,
157160
quota_project_id=quota_project_id,
158161
)
162+
self._ssl_channel_credentials = ssl_credentials
159163
else:
160164
host = host if ":" in host else host + ":443"
161165

google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,16 @@ def __init__(
158158
google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
159159
and ``credentials_file`` are passed.
160160
"""
161+
self._ssl_channel_credentials = ssl_channel_credentials
162+
161163
if channel:
162164
# Sanity check: Ensure that channel and credentials are not both
163165
# provided.
164166
credentials = False
165167

166168
# If a channel was explicitly provided, set it.
167169
self._grpc_channel = channel
170+
self._ssl_channel_credentials = None
168171
elif api_mtls_endpoint:
169172
warnings.warn(
170173
"api_mtls_endpoint and client_cert_source are deprecated",
@@ -201,6 +204,7 @@ def __init__(
201204
scopes=scopes or self.AUTH_SCOPES,
202205
quota_project_id=quota_project_id,
203206
)
207+
self._ssl_channel_credentials = ssl_credentials
204208
else:
205209
host = host if ":" in host else host + ":443"
206210

google/cloud/spanner_admin_database_v1/types/spanner_database_admin.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ class UpdateDatabaseDdlMetadata(proto.Message):
287287
Reports the commit timestamps of all statements that have
288288
succeeded so far, where ``commit_timestamps[i]`` is the
289289
commit timestamp for the statement ``statements[i]``.
290+
throttled (bool):
291+
Output only. When true, indicates that the
292+
operation is throttled e.g due to resource
293+
constraints. When resources become available the
294+
operation will resume and this field will be
295+
false again.
290296
"""
291297

292298
database = proto.Field(proto.STRING, number=1)
@@ -297,6 +303,8 @@ class UpdateDatabaseDdlMetadata(proto.Message):
297303
proto.MESSAGE, number=3, message=timestamp.Timestamp,
298304
)
299305

306+
throttled = proto.Field(proto.BOOL, number=4)
307+
300308

301309
class DropDatabaseRequest(proto.Message):
302310
r"""The request for

google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,16 @@ def __init__(
126126
google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
127127
and ``credentials_file`` are passed.
128128
"""
129+
self._ssl_channel_credentials = ssl_channel_credentials
130+
129131
if channel:
130132
# Sanity check: Ensure that channel and credentials are not both
131133
# provided.
132134
credentials = False
133135

134136
# If a channel was explicitly provided, set it.
135137
self._grpc_channel = channel
138+
self._ssl_channel_credentials = None
136139
elif api_mtls_endpoint:
137140
warnings.warn(
138141
"api_mtls_endpoint and client_cert_source are deprecated",
@@ -169,6 +172,7 @@ def __init__(
169172
scopes=scopes or self.AUTH_SCOPES,
170173
quota_project_id=quota_project_id,
171174
)
175+
self._ssl_channel_credentials = ssl_credentials
172176
else:
173177
host = host if ":" in host else host + ":443"
174178

google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,16 @@ def __init__(
171171
google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
172172
and ``credentials_file`` are passed.
173173
"""
174+
self._ssl_channel_credentials = ssl_channel_credentials
175+
174176
if channel:
175177
# Sanity check: Ensure that channel and credentials are not both
176178
# provided.
177179
credentials = False
178180

179181
# If a channel was explicitly provided, set it.
180182
self._grpc_channel = channel
183+
self._ssl_channel_credentials = None
181184
elif api_mtls_endpoint:
182185
warnings.warn(
183186
"api_mtls_endpoint and client_cert_source are deprecated",
@@ -214,6 +217,7 @@ def __init__(
214217
scopes=scopes or self.AUTH_SCOPES,
215218
quota_project_id=quota_project_id,
216219
)
220+
self._ssl_channel_credentials = ssl_credentials
217221
else:
218222
host = host if ":" in host else host + ":443"
219223

google/cloud/spanner_v1/services/spanner/transports/grpc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,16 @@ def __init__(
106106
google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
107107
and ``credentials_file`` are passed.
108108
"""
109+
self._ssl_channel_credentials = ssl_channel_credentials
110+
109111
if channel:
110112
# Sanity check: Ensure that channel and credentials are not both
111113
# provided.
112114
credentials = False
113115

114116
# If a channel was explicitly provided, set it.
115117
self._grpc_channel = channel
118+
self._ssl_channel_credentials = None
116119
elif api_mtls_endpoint:
117120
warnings.warn(
118121
"api_mtls_endpoint and client_cert_source are deprecated",
@@ -149,6 +152,7 @@ def __init__(
149152
scopes=scopes or self.AUTH_SCOPES,
150153
quota_project_id=quota_project_id,
151154
)
155+
self._ssl_channel_credentials = ssl_credentials
152156
else:
153157
host = host if ":" in host else host + ":443"
154158

0 commit comments

Comments
 (0)