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

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,16 @@ def __init__(
151151
google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
152152
and ``credentials_file`` are passed.
153153
"""
154+
self._ssl_channel_credentials = ssl_channel_credentials
155+
154156
if channel:
155157
# Sanity check: Ensure that channel and credentials are not both
156158
# provided.
157159
credentials = False
158160

159161
# If a channel was explicitly provided, set it.
160162
self._grpc_channel = channel
163+
self._ssl_channel_credentials = None
161164
elif api_mtls_endpoint:
162165
warnings.warn(
163166
"api_mtls_endpoint and client_cert_source are deprecated",
@@ -194,6 +197,7 @@ def __init__(
194197
scopes=scopes or self.AUTH_SCOPES,
195198
quota_project_id=quota_project_id,
196199
)
200+
self._ssl_channel_credentials = ssl_credentials
197201
else:
198202
host = host if ":" in host else host + ":443"
199203

scripts/fixup_spanner_admin_database_v1_keywords.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#! /usr/bin/env python3
12
# -*- coding: utf-8 -*-
23

34
# Copyright 2020 Google LLC

scripts/fixup_spanner_admin_instance_v1_keywords.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#! /usr/bin/env python3
12
# -*- coding: utf-8 -*-
23

34
# Copyright 2020 Google LLC

scripts/fixup_spanner_v1_keywords.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#! /usr/bin/env python3
12
# -*- coding: utf-8 -*-
23

34
# Copyright 2020 Google LLC

synth.metadata

Lines changed: 149 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
{
44
"git": {
55
"name": ".",
6-
"remote": "[email protected]:larkee/python-spanner.git",
7-
"sha": "1d3e65af688c31937b0110223679607c19c328e9"
6+
"remote": "https://github.com/googleapis/python-spanner.git",
7+
"sha": "af5a3c65fbf81a93c1b4d4a8a9f65f06e96df325"
8+
}
9+
},
10+
{
11+
"git": {
12+
"name": "googleapis",
13+
"remote": "https://github.com/googleapis/googleapis.git",
14+
"sha": "53eb2512a55caabcbad1898225080a2a3dfcb6aa",
15+
"internalRef": "346818879"
816
}
917
},
1018
{
@@ -50,5 +58,144 @@
5058
"generator": "bazel"
5159
}
5260
}
61+
],
62+
"generatedFiles": [
63+
".flake8",
64+
".github/CONTRIBUTING.md",
65+
".github/ISSUE_TEMPLATE/bug_report.md",
66+
".github/ISSUE_TEMPLATE/feature_request.md",
67+
".github/ISSUE_TEMPLATE/support_request.md",
68+
".github/PULL_REQUEST_TEMPLATE.md",
69+
".github/release-please.yml",
70+
".github/snippet-bot.yml",
71+
".gitignore",
72+
".kokoro/build.sh",
73+
".kokoro/continuous/common.cfg",
74+
".kokoro/continuous/continuous.cfg",
75+
".kokoro/docker/docs/Dockerfile",
76+
".kokoro/docker/docs/fetch_gpg_keys.sh",
77+
".kokoro/docs/common.cfg",
78+
".kokoro/docs/docs-presubmit.cfg",
79+
".kokoro/docs/docs.cfg",
80+
".kokoro/populate-secrets.sh",
81+
".kokoro/presubmit/common.cfg",
82+
".kokoro/presubmit/presubmit.cfg",
83+
".kokoro/publish-docs.sh",
84+
".kokoro/release.sh",
85+
".kokoro/release/common.cfg",
86+
".kokoro/release/release.cfg",
87+
".kokoro/samples/lint/common.cfg",
88+
".kokoro/samples/lint/continuous.cfg",
89+
".kokoro/samples/lint/periodic.cfg",
90+
".kokoro/samples/lint/presubmit.cfg",
91+
".kokoro/samples/python3.6/common.cfg",
92+
".kokoro/samples/python3.6/continuous.cfg",
93+
".kokoro/samples/python3.6/periodic.cfg",
94+
".kokoro/samples/python3.6/presubmit.cfg",
95+
".kokoro/samples/python3.7/common.cfg",
96+
".kokoro/samples/python3.7/continuous.cfg",
97+
".kokoro/samples/python3.7/periodic.cfg",
98+
".kokoro/samples/python3.7/presubmit.cfg",
99+
".kokoro/samples/python3.8/common.cfg",
100+
".kokoro/samples/python3.8/continuous.cfg",
101+
".kokoro/samples/python3.8/periodic.cfg",
102+
".kokoro/samples/python3.8/presubmit.cfg",
103+
".kokoro/test-samples.sh",
104+
".kokoro/trampoline.sh",
105+
".kokoro/trampoline_v2.sh",
106+
".trampolinerc",
107+
"CODE_OF_CONDUCT.md",
108+
"CONTRIBUTING.rst",
109+
"LICENSE",
110+
"MANIFEST.in",
111+
"docs/_static/custom.css",
112+
"docs/_templates/layout.html",
113+
"docs/conf.py",
114+
"docs/multiprocessing.rst",
115+
"docs/spanner_admin_database_v1/services.rst",
116+
"docs/spanner_admin_database_v1/types.rst",
117+
"docs/spanner_admin_instance_v1/services.rst",
118+
"docs/spanner_admin_instance_v1/types.rst",
119+
"docs/spanner_v1/services.rst",
120+
"docs/spanner_v1/types.rst",
121+
"google/cloud/spanner_admin_database_v1/__init__.py",
122+
"google/cloud/spanner_admin_database_v1/proto/backup.proto",
123+
"google/cloud/spanner_admin_database_v1/proto/common.proto",
124+
"google/cloud/spanner_admin_database_v1/proto/spanner_database_admin.proto",
125+
"google/cloud/spanner_admin_database_v1/py.typed",
126+
"google/cloud/spanner_admin_database_v1/services/__init__.py",
127+
"google/cloud/spanner_admin_database_v1/services/database_admin/__init__.py",
128+
"google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py",
129+
"google/cloud/spanner_admin_database_v1/services/database_admin/client.py",
130+
"google/cloud/spanner_admin_database_v1/services/database_admin/pagers.py",
131+
"google/cloud/spanner_admin_database_v1/services/database_admin/transports/__init__.py",
132+
"google/cloud/spanner_admin_database_v1/services/database_admin/transports/base.py",
133+
"google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py",
134+
"google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py",
135+
"google/cloud/spanner_admin_database_v1/types/__init__.py",
136+
"google/cloud/spanner_admin_database_v1/types/backup.py",
137+
"google/cloud/spanner_admin_database_v1/types/common.py",
138+
"google/cloud/spanner_admin_database_v1/types/spanner_database_admin.py",
139+
"google/cloud/spanner_admin_instance_v1/__init__.py",
140+
"google/cloud/spanner_admin_instance_v1/proto/spanner_instance_admin.proto",
141+
"google/cloud/spanner_admin_instance_v1/py.typed",
142+
"google/cloud/spanner_admin_instance_v1/services/__init__.py",
143+
"google/cloud/spanner_admin_instance_v1/services/instance_admin/__init__.py",
144+
"google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py",
145+
"google/cloud/spanner_admin_instance_v1/services/instance_admin/client.py",
146+
"google/cloud/spanner_admin_instance_v1/services/instance_admin/pagers.py",
147+
"google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/__init__.py",
148+
"google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/base.py",
149+
"google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py",
150+
"google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py",
151+
"google/cloud/spanner_admin_instance_v1/types/__init__.py",
152+
"google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py",
153+
"google/cloud/spanner_v1/proto/keys.proto",
154+
"google/cloud/spanner_v1/proto/mutation.proto",
155+
"google/cloud/spanner_v1/proto/query_plan.proto",
156+
"google/cloud/spanner_v1/proto/result_set.proto",
157+
"google/cloud/spanner_v1/proto/spanner.proto",
158+
"google/cloud/spanner_v1/proto/transaction.proto",
159+
"google/cloud/spanner_v1/proto/type.proto",
160+
"google/cloud/spanner_v1/py.typed",
161+
"google/cloud/spanner_v1/services/__init__.py",
162+
"google/cloud/spanner_v1/services/spanner/__init__.py",
163+
"google/cloud/spanner_v1/services/spanner/async_client.py",
164+
"google/cloud/spanner_v1/services/spanner/client.py",
165+
"google/cloud/spanner_v1/services/spanner/pagers.py",
166+
"google/cloud/spanner_v1/services/spanner/transports/__init__.py",
167+
"google/cloud/spanner_v1/services/spanner/transports/base.py",
168+
"google/cloud/spanner_v1/services/spanner/transports/grpc.py",
169+
"google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py",
170+
"google/cloud/spanner_v1/types/__init__.py",
171+
"google/cloud/spanner_v1/types/keys.py",
172+
"google/cloud/spanner_v1/types/mutation.py",
173+
"google/cloud/spanner_v1/types/query_plan.py",
174+
"google/cloud/spanner_v1/types/result_set.py",
175+
"google/cloud/spanner_v1/types/spanner.py",
176+
"google/cloud/spanner_v1/types/transaction.py",
177+
"google/cloud/spanner_v1/types/type.py",
178+
"renovate.json",
179+
"samples/AUTHORING_GUIDE.md",
180+
"samples/CONTRIBUTING.md",
181+
"samples/samples/noxfile.py",
182+
"scripts/decrypt-secrets.sh",
183+
"scripts/fixup_spanner_admin_database_v1_keywords.py",
184+
"scripts/fixup_spanner_admin_instance_v1_keywords.py",
185+
"scripts/fixup_spanner_v1_keywords.py",
186+
"scripts/readme-gen/readme_gen.py",
187+
"scripts/readme-gen/templates/README.tmpl.rst",
188+
"scripts/readme-gen/templates/auth.tmpl.rst",
189+
"scripts/readme-gen/templates/auth_api_key.tmpl.rst",
190+
"scripts/readme-gen/templates/install_deps.tmpl.rst",
191+
"scripts/readme-gen/templates/install_portaudio.tmpl.rst",
192+
"setup.cfg",
193+
"testing/.gitignore",
194+
"tests/unit/gapic/spanner_admin_database_v1/__init__.py",
195+
"tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py",
196+
"tests/unit/gapic/spanner_admin_instance_v1/__init__.py",
197+
"tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py",
198+
"tests/unit/gapic/spanner_v1/__init__.py",
199+
"tests/unit/gapic/spanner_v1/test_spanner.py"
53200
]
54201
}

0 commit comments

Comments
 (0)