Skip to content

Commit

Permalink
feat(spanner): adding EXPECTED_FULFILLMENT_PERIOD to the indicate i…
Browse files Browse the repository at this point in the history
…nstance 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>
  • Loading branch information
3 people committed Apr 4, 2024
1 parent 0ee9831 commit 5292e03
Show file tree
Hide file tree
Showing 15 changed files with 1,239 additions and 155 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -12,4 +12,3 @@ system-test/*key.json
.DS_Store
package-lock.json
__pycache__
.vscode
16 changes: 15 additions & 1 deletion protos/google/spanner/admin/instance/v1/common.proto
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,3 +40,17 @@ message OperationProgress {
// successfully.
google.protobuf.Timestamp end_time = 3;
}

// Indicates the expected fulfillment period of an operation.
enum FulfillmentPeriod {
// Not specified.
FULFILLMENT_PERIOD_UNSPECIFIED = 0;

// Normal fulfillment period. The operation is expected to complete within
// minutes.
FULFILLMENT_PERIOD_NORMAL = 1;

// Extended fulfillment period. It can take up to an hour for the operation
// to complete.
FULFILLMENT_PERIOD_EXTENDED = 2;
}
Expand Up @@ -1282,6 +1282,9 @@ message CreateInstanceMetadata {

// The time at which this operation failed or was completed successfully.
google.protobuf.Timestamp end_time = 4;

// The expected fulfillment period of this create operation.
FulfillmentPeriod expected_fulfillment_period = 5;
}

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

// The time at which this operation failed or was completed successfully.
google.protobuf.Timestamp end_time = 4;

// The expected fulfillment period of this update operation.
FulfillmentPeriod expected_fulfillment_period = 5;
}

// Metadata type for the operation returned by
Expand Down
34 changes: 29 additions & 5 deletions protos/google/spanner/executor/v1/cloud_executor.proto
Expand Up @@ -78,6 +78,9 @@ message SpannerAction {
// database path if it applies to the same database as the previous action.
string database_path = 1;

// Configuration options for Spanner backend
SpannerOptions spanner_options = 2;

// Action represents a spanner action kind, there will only be one action kind
// per SpannerAction.
oneof action {
Expand Down Expand Up @@ -565,8 +568,8 @@ message AdminAction {
// Action that cancels an operation.
CancelOperationAction cancel_operation = 26;

// Action that reconfigures a Cloud Spanner database.
ReconfigureCloudDatabaseAction reconfigure_cloud_database = 28;
// Action that changes quorum of a Cloud Spanner database.
ChangeQuorumCloudDatabaseAction change_quorum_cloud_database = 28;
}
}

Expand Down Expand Up @@ -772,9 +775,9 @@ message DropCloudDatabaseAction {
string database_id = 3;
}

// Action that reconfigures a Cloud Spanner database.
message ReconfigureCloudDatabaseAction {
// The fully qualified uri of the database to be reconfigured.
// Action that changes quorum of a Cloud Spanner database.
message ChangeQuorumCloudDatabaseAction {
// The fully qualified uri of the database whose quorum has to be changed.
optional string database_uri = 1;

// The locations of the serving regions, e.g. "asia-south1".
Expand Down Expand Up @@ -877,6 +880,10 @@ message RestoreCloudDatabaseAction {
// The id of the database to create and restore to, e.g. "db0". Note that this
// database must not already exist.
string database_id = 5;

// The KMS key(s) used to encrypt the restored database to be created if the
// restored database should be CMEK protected.
google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7;
}

// Action that gets a Cloud Spanner database.
Expand Down Expand Up @@ -916,6 +923,10 @@ message CreateCloudBackupAction {
// [earliest_version_time, NOW], where earliest_version_time is retrieved by
// cloud spanner frontend API (See details: go/cs-pitr-lite-design).
optional google.protobuf.Timestamp version_time = 6;

// The KMS key(s) used to encrypt the backup to be created if the backup
// should be CMEK protected.
google.spanner.admin.database.v1.EncryptionConfig encryption_config = 7;
}

// Action that copies a Cloud Spanner database backup.
Expand Down Expand Up @@ -1481,3 +1492,16 @@ message HeartbeatRecord {
// Timestamp for this heartbeat check.
google.protobuf.Timestamp heartbeat_time = 1;
}

// Options for Cloud Spanner Service.
message SpannerOptions {
// Options for configuring the session pool
SessionPoolOptions session_pool_options = 1;
}

// Options for the session pool used by the DatabaseClient.
message SessionPoolOptions {
// passing this as true, will make applicable RPCs use multiplexed sessions
// instead of regular sessions
bool use_multiplexed = 1;
}
311 changes: 271 additions & 40 deletions protos/protos.d.ts

Large diffs are not rendered by default.

774 changes: 690 additions & 84 deletions protos/protos.js

Large diffs are not rendered by default.

51 changes: 47 additions & 4 deletions protos/protos.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions src/v1/database_admin_client.ts
Expand Up @@ -128,8 +128,15 @@ export class DatabaseAdminClient {
'Please set either universe_domain or universeDomain, but not both.'
);
}
const universeDomainEnvVar =
typeof process === 'object' && typeof process.env === 'object'
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
: undefined;
this._universeDomain =
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
opts?.universeDomain ??
opts?.universe_domain ??
universeDomainEnvVar ??
'googleapis.com';
this._servicePath = 'spanner.' + this._universeDomain;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
Expand Down Expand Up @@ -181,7 +188,7 @@ export class DatabaseAdminClient {

// Determine the client header string.
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
if (typeof process !== 'undefined' && 'versions' in process) {
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
Expand Down Expand Up @@ -488,7 +495,7 @@ export class DatabaseAdminClient {
*/
static get servicePath() {
if (
typeof process !== undefined &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
Expand All @@ -506,7 +513,7 @@ export class DatabaseAdminClient {
*/
static get apiEndpoint() {
if (
typeof process !== undefined &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
Expand Down
15 changes: 11 additions & 4 deletions src/v1/instance_admin_client.ts
Expand Up @@ -142,8 +142,15 @@ export class InstanceAdminClient {
'Please set either universe_domain or universeDomain, but not both.'
);
}
const universeDomainEnvVar =
typeof process === 'object' && typeof process.env === 'object'
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
: undefined;
this._universeDomain =
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
opts?.universeDomain ??
opts?.universe_domain ??
universeDomainEnvVar ??
'googleapis.com';
this._servicePath = 'spanner.' + this._universeDomain;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
Expand Down Expand Up @@ -195,7 +202,7 @@ export class InstanceAdminClient {

// Determine the client header string.
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
if (typeof process !== 'undefined' && 'versions' in process) {
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
Expand Down Expand Up @@ -492,7 +499,7 @@ export class InstanceAdminClient {
*/
static get servicePath() {
if (
typeof process !== undefined &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
Expand All @@ -510,7 +517,7 @@ export class InstanceAdminClient {
*/
static get apiEndpoint() {
if (
typeof process !== undefined &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
Expand Down
15 changes: 11 additions & 4 deletions src/v1/spanner_client.ts
Expand Up @@ -122,8 +122,15 @@ export class SpannerClient {
'Please set either universe_domain or universeDomain, but not both.'
);
}
const universeDomainEnvVar =
typeof process === 'object' && typeof process.env === 'object'
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
: undefined;
this._universeDomain =
opts?.universeDomain ?? opts?.universe_domain ?? 'googleapis.com';
opts?.universeDomain ??
opts?.universe_domain ??
universeDomainEnvVar ??
'googleapis.com';
this._servicePath = 'spanner.' + this._universeDomain;
const servicePath =
opts?.servicePath || opts?.apiEndpoint || this._servicePath;
Expand Down Expand Up @@ -175,7 +182,7 @@ export class SpannerClient {

// Determine the client header string.
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
if (typeof process !== 'undefined' && 'versions' in process) {
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
Expand Down Expand Up @@ -352,7 +359,7 @@ export class SpannerClient {
*/
static get servicePath() {
if (
typeof process !== undefined &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
Expand All @@ -370,7 +377,7 @@ export class SpannerClient {
*/
static get apiEndpoint() {
if (
typeof process !== undefined &&
typeof process === 'object' &&
typeof process.emitWarning === 'function'
) {
process.emitWarning(
Expand Down

0 comments on commit 5292e03

Please sign in to comment.