Skip to content

Commit 5292e03

Browse files
feat(spanner): adding EXPECTED_FULFILLMENT_PERIOD to the indicate instance creation times (with FULFILLMENT_PERIOD_NORMAL or FULFILLMENT_PERIOD_EXTENDED ENUM) with the extended instance creation time triggered by On-Demand Capacity Feature (#2024)
* feat: add several fields to manage state of database encryption update PiperOrigin-RevId: 619289281 Source-Link: googleapis/googleapis@3a7c334 Source-Link: googleapis/googleapis-gen@6a8c733 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmE4YzczMzA2MmQ4MzNkMTFjNTI0NWVkYTUwZjUxMDhlMGU1NTMyNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add SessionPoolOptions, SpannerOptions protos in executor protos PiperOrigin-RevId: 621265883 Source-Link: googleapis/googleapis@fed9845 Source-Link: googleapis/googleapis-gen@c66a769 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzY2YTc2OTU3ZTJlMTYzNDdiYzFkZDNmNGM2MzgyMjNmMDY1ZWU4MCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat(spanner): adding `EXPECTED_FULFILLMENT_PERIOD` to the indicate instance creation times (with `FULFILLMENT_PERIOD_NORMAL` or `FULFILLMENT_PERIOD_EXTENDED` ENUM) with the extended instance creation time triggered by On-Demand Capacity Feature PiperOrigin-RevId: 621488048 Source-Link: googleapis/googleapis@0aa0992 Source-Link: googleapis/googleapis-gen@b8ad4c7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjhhZDRjNzNhNWMwNWZlZDhiY2ZkZGI5MzEzMjY5OTZjMzQ0MTc5MSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: danieljbruce <danieljbruce@users.noreply.github.com>
1 parent 0ee9831 commit 5292e03

15 files changed

+1239
-155
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ system-test/*key.json
1212
.DS_Store
1313
package-lock.json
1414
__pycache__
15-
.vscode

protos/google/spanner/admin/instance/v1/common.proto

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -40,3 +40,17 @@ message OperationProgress {
4040
// successfully.
4141
google.protobuf.Timestamp end_time = 3;
4242
}
43+
44+
// Indicates the expected fulfillment period of an operation.
45+
enum FulfillmentPeriod {
46+
// Not specified.
47+
FULFILLMENT_PERIOD_UNSPECIFIED = 0;
48+
49+
// Normal fulfillment period. The operation is expected to complete within
50+
// minutes.
51+
FULFILLMENT_PERIOD_NORMAL = 1;
52+
53+
// Extended fulfillment period. It can take up to an hour for the operation
54+
// to complete.
55+
FULFILLMENT_PERIOD_EXTENDED = 2;
56+
}

protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,6 +1282,9 @@ message CreateInstanceMetadata {
12821282

12831283
// The time at which this operation failed or was completed successfully.
12841284
google.protobuf.Timestamp end_time = 4;
1285+
1286+
// The expected fulfillment period of this create operation.
1287+
FulfillmentPeriod expected_fulfillment_period = 5;
12851288
}
12861289

12871290
// Metadata type for the operation returned by
@@ -1302,6 +1305,9 @@ message UpdateInstanceMetadata {
13021305

13031306
// The time at which this operation failed or was completed successfully.
13041307
google.protobuf.Timestamp end_time = 4;
1308+
1309+
// The expected fulfillment period of this update operation.
1310+
FulfillmentPeriod expected_fulfillment_period = 5;
13051311
}
13061312

13071313
// Metadata type for the operation returned by

protos/google/spanner/executor/v1/cloud_executor.proto

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ message SpannerAction {
7878
// database path if it applies to the same database as the previous action.
7979
string database_path = 1;
8080

81+
// Configuration options for Spanner backend
82+
SpannerOptions spanner_options = 2;
83+
8184
// Action represents a spanner action kind, there will only be one action kind
8285
// per SpannerAction.
8386
oneof action {
@@ -565,8 +568,8 @@ message AdminAction {
565568
// Action that cancels an operation.
566569
CancelOperationAction cancel_operation = 26;
567570

568-
// Action that reconfigures a Cloud Spanner database.
569-
ReconfigureCloudDatabaseAction reconfigure_cloud_database = 28;
571+
// Action that changes quorum of a Cloud Spanner database.
572+
ChangeQuorumCloudDatabaseAction change_quorum_cloud_database = 28;
570573
}
571574
}
572575

@@ -772,9 +775,9 @@ message DropCloudDatabaseAction {
772775
string database_id = 3;
773776
}
774777

775-
// Action that reconfigures a Cloud Spanner database.
776-
message ReconfigureCloudDatabaseAction {
777-
// The fully qualified uri of the database to be reconfigured.
778+
// Action that changes quorum of a Cloud Spanner database.
779+
message ChangeQuorumCloudDatabaseAction {
780+
// The fully qualified uri of the database whose quorum has to be changed.
778781
optional string database_uri = 1;
779782

780783
// The locations of the serving regions, e.g. "asia-south1".
@@ -877,6 +880,10 @@ message RestoreCloudDatabaseAction {
877880
// The id of the database to create and restore to, e.g. "db0". Note that this
878881
// database must not already exist.
879882
string database_id = 5;
883+
884+
// The KMS key(s) used to encrypt the restored database to be created if the
885+
// restored database should be CMEK protected.
886+
google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7;
880887
}
881888

882889
// Action that gets a Cloud Spanner database.
@@ -916,6 +923,10 @@ message CreateCloudBackupAction {
916923
// [earliest_version_time, NOW], where earliest_version_time is retrieved by
917924
// cloud spanner frontend API (See details: go/cs-pitr-lite-design).
918925
optional google.protobuf.Timestamp version_time = 6;
926+
927+
// The KMS key(s) used to encrypt the backup to be created if the backup
928+
// should be CMEK protected.
929+
google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7;
919930
}
920931

921932
// Action that copies a Cloud Spanner database backup.
@@ -1481,3 +1492,16 @@ message HeartbeatRecord {
14811492
// Timestamp for this heartbeat check.
14821493
google.protobuf.Timestamp heartbeat_time = 1;
14831494
}
1495+
1496+
// Options for Cloud Spanner Service.
1497+
message SpannerOptions {
1498+
// Options for configuring the session pool
1499+
SessionPoolOptions session_pool_options = 1;
1500+
}
1501+
1502+
// Options for the session pool used by the DatabaseClient.
1503+
message SessionPoolOptions {
1504+
// passing this as true, will make applicable RPCs use multiplexed sessions
1505+
// instead of regular sessions
1506+
bool use_multiplexed = 1;
1507+
}

protos/protos.d.ts

Lines changed: 271 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/protos.js

Lines changed: 690 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/protos.json

Lines changed: 47 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/v1/database_admin_client.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,15 @@ export class DatabaseAdminClient {
128128
'Please set either universe_domain or universeDomain, but not both.'
129129
);
130130
}
131+
const universeDomainEnvVar =
132+
typeof process === 'object' && typeof process.env === 'object'
133+
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
134+
: undefined;
131135
this._universeDomain =
132-
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
136+
opts?.universeDomain ??
137+
opts?.universe_domain ??
138+
universeDomainEnvVar ??
139+
'googleapis.com';
133140
this._servicePath = 'spanner.' + this._universeDomain;
134141
const servicePath =
135142
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
@@ -181,7 +188,7 @@ export class DatabaseAdminClient {
181188

182189
// Determine the client header string.
183190
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
184-
if (typeof process !== 'undefined' && 'versions' in process) {
191+
if (typeof process === 'object' && 'versions' in process) {
185192
clientHeader.push(`gl-node/${process.versions.node}`);
186193
} else {
187194
clientHeader.push(`gl-web/${this._gaxModule.version}`);
@@ -488,7 +495,7 @@ export class DatabaseAdminClient {
488495
*/
489496
static get servicePath() {
490497
if (
491-
typeof process !== undefined &&
498+
typeof process === 'object' &&
492499
typeof process.emitWarning === 'function'
493500
) {
494501
process.emitWarning(
@@ -506,7 +513,7 @@ export class DatabaseAdminClient {
506513
*/
507514
static get apiEndpoint() {
508515
if (
509-
typeof process !== undefined &&
516+
typeof process === 'object' &&
510517
typeof process.emitWarning === 'function'
511518
) {
512519
process.emitWarning(

src/v1/instance_admin_client.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,15 @@ export class InstanceAdminClient {
142142
'Please set either universe_domain or universeDomain, but not both.'
143143
);
144144
}
145+
const universeDomainEnvVar =
146+
typeof process === 'object' && typeof process.env === 'object'
147+
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
148+
: undefined;
145149
this._universeDomain =
146-
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
150+
opts?.universeDomain ??
151+
opts?.universe_domain ??
152+
universeDomainEnvVar ??
153+
'googleapis.com';
147154
this._servicePath = 'spanner.' + this._universeDomain;
148155
const servicePath =
149156
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
@@ -195,7 +202,7 @@ export class InstanceAdminClient {
195202

196203
// Determine the client header string.
197204
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
198-
if (typeof process !== 'undefined' && 'versions' in process) {
205+
if (typeof process === 'object' && 'versions' in process) {
199206
clientHeader.push(`gl-node/${process.versions.node}`);
200207
} else {
201208
clientHeader.push(`gl-web/${this._gaxModule.version}`);
@@ -492,7 +499,7 @@ export class InstanceAdminClient {
492499
*/
493500
static get servicePath() {
494501
if (
495-
typeof process !== undefined &&
502+
typeof process === 'object' &&
496503
typeof process.emitWarning === 'function'
497504
) {
498505
process.emitWarning(
@@ -510,7 +517,7 @@ export class InstanceAdminClient {
510517
*/
511518
static get apiEndpoint() {
512519
if (
513-
typeof process !== undefined &&
520+
typeof process === 'object' &&
514521
typeof process.emitWarning === 'function'
515522
) {
516523
process.emitWarning(

src/v1/spanner_client.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,15 @@ export class SpannerClient {
122122
'Please set either universe_domain or universeDomain, but not both.'
123123
);
124124
}
125+
const universeDomainEnvVar =
126+
typeof process === 'object' && typeof process.env === 'object'
127+
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
128+
: undefined;
125129
this._universeDomain =
126-
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
130+
opts?.universeDomain ??
131+
opts?.universe_domain ??
132+
universeDomainEnvVar ??
133+
'googleapis.com';
127134
this._servicePath = 'spanner.' + this._universeDomain;
128135
const servicePath =
129136
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
@@ -175,7 +182,7 @@ export class SpannerClient {
175182

176183
// Determine the client header string.
177184
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
178-
if (typeof process !== 'undefined' && 'versions' in process) {
185+
if (typeof process === 'object' && 'versions' in process) {
179186
clientHeader.push(`gl-node/${process.versions.node}`);
180187
} else {
181188
clientHeader.push(`gl-web/${this._gaxModule.version}`);
@@ -352,7 +359,7 @@ export class SpannerClient {
352359
*/
353360
static get servicePath() {
354361
if (
355-
typeof process !== undefined &&
362+
typeof process === 'object' &&
356363
typeof process.emitWarning === 'function'
357364
) {
358365
process.emitWarning(
@@ -370,7 +377,7 @@ export class SpannerClient {
370377
*/
371378
static get apiEndpoint() {
372379
if (
373-
typeof process !== undefined &&
380+
typeof process === 'object' &&
374381
typeof process.emitWarning === 'function'
375382
) {
376383
process.emitWarning(

0 commit comments

Comments
 (0)