|
40 | 40 | database_admin_grpc_transport,
|
41 | 41 | )
|
42 | 42 | from google.cloud.spanner_admin_database_v1.proto import backup_pb2
|
| 43 | +from google.cloud.spanner_admin_database_v1.proto import common_pb2 |
43 | 44 | from google.cloud.spanner_admin_database_v1.proto import spanner_database_admin_pb2
|
44 | 45 | from google.cloud.spanner_admin_database_v1.proto import spanner_database_admin_pb2_grpc
|
45 | 46 | from google.iam.v1 import iam_policy_pb2
|
@@ -100,6 +101,17 @@ def backup_path(cls, project, instance, backup):
|
100 | 101 | backup=backup,
|
101 | 102 | )
|
102 | 103 |
|
| 104 | + @classmethod |
| 105 | + def crypto_key_path(cls, project, location, key_ring, crypto_key): |
| 106 | + """Return a fully-qualified crypto_key string.""" |
| 107 | + return google.api_core.path_template.expand( |
| 108 | + "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}", |
| 109 | + project=project, |
| 110 | + location=location, |
| 111 | + key_ring=key_ring, |
| 112 | + crypto_key=crypto_key, |
| 113 | + ) |
| 114 | + |
103 | 115 | @classmethod
|
104 | 116 | def database_path(cls, project, instance, database):
|
105 | 117 | """Return a fully-qualified database string."""
|
@@ -341,6 +353,7 @@ def create_database(
|
341 | 353 | parent,
|
342 | 354 | create_statement,
|
343 | 355 | extra_statements=None,
|
| 356 | + encryption_config=None, |
344 | 357 | retry=google.api_core.gapic_v1.method.DEFAULT,
|
345 | 358 | timeout=google.api_core.gapic_v1.method.DEFAULT,
|
346 | 359 | metadata=None,
|
@@ -386,6 +399,10 @@ def create_database(
|
386 | 399 | database. Statements can create tables, indexes, etc. These
|
387 | 400 | statements execute atomically with the creation of the database:
|
388 | 401 | if there is an error in any statement, the database is not created.
|
| 402 | + encryption_config (Union[dict, ~google.cloud.spanner_admin_database_v1.types.EncryptionConfig]): Optional. |
| 403 | +
|
| 404 | + If a dict is provided, it must be of the same form as the protobuf |
| 405 | + message :class:`~google.cloud.spanner_admin_database_v1.types.EncryptionConfig` |
389 | 406 | retry (Optional[google.api_core.retry.Retry]): A retry object used
|
390 | 407 | to retry requests. If ``None`` is specified, requests will
|
391 | 408 | be retried using a default configuration.
|
@@ -420,6 +437,7 @@ def create_database(
|
420 | 437 | parent=parent,
|
421 | 438 | create_statement=create_statement,
|
422 | 439 | extra_statements=extra_statements,
|
| 440 | + encryption_config=encryption_config, |
423 | 441 | )
|
424 | 442 | if metadata is None:
|
425 | 443 | metadata = []
|
|
0 commit comments