@google-cloud/spanner 5.16.3 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/README.md +28 -12
- package/build/protos/google/spanner/admin/database/v1/backup.proto +177 -9
- package/build/protos/google/spanner/admin/database/v1/common.proto +14 -2
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +40 -5
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +8 -5
- package/build/protos/google/spanner/v1/commit_response.proto +2 -4
- package/build/protos/google/spanner/v1/keys.proto +0 -1
- package/build/protos/google/spanner/v1/mutation.proto +5 -5
- package/build/protos/google/spanner/v1/query_plan.proto +18 -19
- package/build/protos/google/spanner/v1/result_set.proto +1 -1
- package/build/protos/google/spanner/v1/spanner.proto +21 -19
- package/build/protos/google/spanner/v1/transaction.proto +19 -32
- package/build/protos/google/spanner/v1/type.proto +33 -7
- package/build/protos/protos.d.ts +684 -64
- package/build/protos/protos.js +1760 -84
- package/build/protos/protos.json +273 -21
- package/build/src/backup.d.ts +27 -5
- package/build/src/backup.js +62 -31
- package/build/src/batch-transaction.js +1 -1
- package/build/src/codec.d.ts +11 -0
- package/build/src/codec.js +39 -2
- package/build/src/common-grpc/service-object.js +1 -1
- package/build/src/common-grpc/service.js +2 -2
- package/build/src/database.d.ts +26 -6
- package/build/src/database.js +8 -8
- package/build/src/index.d.ts +18 -3
- package/build/src/index.js +26 -7
- package/build/src/instance.d.ts +42 -2
- package/build/src/instance.js +56 -2
- package/build/src/session-pool.d.ts +1 -0
- package/build/src/session-pool.js +46 -46
- package/build/src/session.js +1 -1
- package/build/src/table.d.ts +5 -1
- package/build/src/table.js +1 -1
- package/build/src/transaction-runner.js +3 -3
- package/build/src/transaction.d.ts +10 -2
- package/build/src/transaction.js +12 -12
- package/build/src/v1/database_admin_client.d.ts +271 -28
- package/build/src/v1/database_admin_client.js +113 -11
- package/build/src/v1/database_admin_client_config.json +5 -0
- package/build/src/v1/index.js +1 -0
- package/build/src/v1/instance_admin_client.d.ts +57 -11
- package/build/src/v1/instance_admin_client.js +2 -3
- package/build/src/v1/spanner_client.d.ts +66 -44
- package/build/src/v1/spanner_client.js +13 -11
- package/package.json +11 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2022 Google LLC
|
|
3
3
|
//
|
|
4
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -32,10 +32,11 @@ const version = require('../../../package.json').version;
|
|
|
32
32
|
/**
|
|
33
33
|
* Cloud Spanner Database Admin API
|
|
34
34
|
*
|
|
35
|
-
* The Cloud Spanner Database Admin API can be used to
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
35
|
+
* The Cloud Spanner Database Admin API can be used to:
|
|
36
|
+
* * create, drop, and list databases
|
|
37
|
+
* * update the schema of pre-existing databases
|
|
38
|
+
* * create, delete and list backups for a database
|
|
39
|
+
* * restore a database from an existing backup
|
|
39
40
|
* @class
|
|
40
41
|
* @memberof v1
|
|
41
42
|
*/
|
|
@@ -164,12 +165,15 @@ class DatabaseAdminClient {
|
|
|
164
165
|
const updateDatabaseDdlMetadata = protoFilesRoot.lookup('.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata');
|
|
165
166
|
const createBackupResponse = protoFilesRoot.lookup('.google.spanner.admin.database.v1.Backup');
|
|
166
167
|
const createBackupMetadata = protoFilesRoot.lookup('.google.spanner.admin.database.v1.CreateBackupMetadata');
|
|
168
|
+
const copyBackupResponse = protoFilesRoot.lookup('.google.spanner.admin.database.v1.Backup');
|
|
169
|
+
const copyBackupMetadata = protoFilesRoot.lookup('.google.spanner.admin.database.v1.CopyBackupMetadata');
|
|
167
170
|
const restoreDatabaseResponse = protoFilesRoot.lookup('.google.spanner.admin.database.v1.Database');
|
|
168
171
|
const restoreDatabaseMetadata = protoFilesRoot.lookup('.google.spanner.admin.database.v1.RestoreDatabaseMetadata');
|
|
169
172
|
this.descriptors.longrunning = {
|
|
170
173
|
createDatabase: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createDatabaseResponse.decode.bind(createDatabaseResponse), createDatabaseMetadata.decode.bind(createDatabaseMetadata)),
|
|
171
174
|
updateDatabaseDdl: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateDatabaseDdlResponse.decode.bind(updateDatabaseDdlResponse), updateDatabaseDdlMetadata.decode.bind(updateDatabaseDdlMetadata)),
|
|
172
175
|
createBackup: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createBackupResponse.decode.bind(createBackupResponse), createBackupMetadata.decode.bind(createBackupMetadata)),
|
|
176
|
+
copyBackup: new this._gaxModule.LongrunningDescriptor(this.operationsClient, copyBackupResponse.decode.bind(copyBackupResponse), copyBackupMetadata.decode.bind(copyBackupMetadata)),
|
|
173
177
|
restoreDatabase: new this._gaxModule.LongrunningDescriptor(this.operationsClient, restoreDatabaseResponse.decode.bind(restoreDatabaseResponse), restoreDatabaseMetadata.decode.bind(restoreDatabaseMetadata)),
|
|
174
178
|
};
|
|
175
179
|
// Put together the default options sent with requests.
|
|
@@ -216,6 +220,7 @@ class DatabaseAdminClient {
|
|
|
216
220
|
'getIamPolicy',
|
|
217
221
|
'testIamPermissions',
|
|
218
222
|
'createBackup',
|
|
223
|
+
'copyBackup',
|
|
219
224
|
'getBackup',
|
|
220
225
|
'updateBackup',
|
|
221
226
|
'deleteBackup',
|
|
@@ -580,6 +585,44 @@ class DatabaseAdminClient {
|
|
|
580
585
|
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createBackup, gax.createDefaultBackoffSettings());
|
|
581
586
|
return decodeOperation;
|
|
582
587
|
}
|
|
588
|
+
copyBackup(request, optionsOrCallback, callback) {
|
|
589
|
+
request = request || {};
|
|
590
|
+
let options;
|
|
591
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
592
|
+
callback = optionsOrCallback;
|
|
593
|
+
options = {};
|
|
594
|
+
}
|
|
595
|
+
else {
|
|
596
|
+
options = optionsOrCallback;
|
|
597
|
+
}
|
|
598
|
+
options = options || {};
|
|
599
|
+
options.otherArgs = options.otherArgs || {};
|
|
600
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
601
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
602
|
+
gax.routingHeader.fromParams({
|
|
603
|
+
parent: request.parent || '',
|
|
604
|
+
});
|
|
605
|
+
this.initialize();
|
|
606
|
+
return this.innerApiCalls.copyBackup(request, options, callback);
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Check the status of the long running operation returned by `copyBackup()`.
|
|
610
|
+
* @param {String} name
|
|
611
|
+
* The operation name that will be passed.
|
|
612
|
+
* @returns {Promise} - The promise which resolves to an object.
|
|
613
|
+
* The decoded operation object has result and metadata field to get information from.
|
|
614
|
+
* Please see the
|
|
615
|
+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
616
|
+
* for more details and examples.
|
|
617
|
+
* @example <caption>include:samples/generated/v1/database_admin.copy_backup.js</caption>
|
|
618
|
+
* region_tag:spanner_v1_generated_DatabaseAdmin_CopyBackup_async
|
|
619
|
+
*/
|
|
620
|
+
async checkCopyBackupProgress(name) {
|
|
621
|
+
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
622
|
+
const [operation] = await this.operationsClient.getOperation(request);
|
|
623
|
+
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.copyBackup, gax.createDefaultBackoffSettings());
|
|
624
|
+
return decodeOperation;
|
|
625
|
+
}
|
|
583
626
|
restoreDatabase(request, optionsOrCallback, callback) {
|
|
584
627
|
request = request || {};
|
|
585
628
|
let options;
|
|
@@ -943,6 +986,8 @@ class DatabaseAdminClient {
|
|
|
943
986
|
* for {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} is
|
|
944
987
|
* `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
|
|
945
988
|
* * `metadata.<field_name>` - any field in metadata.value.
|
|
989
|
+
* `metadata.@type` must be specified first, if filtering on metadata
|
|
990
|
+
* fields.
|
|
946
991
|
* * `error` - Error associated with the long-running operation.
|
|
947
992
|
* * `response.@type` - the type of response.
|
|
948
993
|
* * `response.<field_name>` - any field in response.value.
|
|
@@ -1027,6 +1072,8 @@ class DatabaseAdminClient {
|
|
|
1027
1072
|
* for {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} is
|
|
1028
1073
|
* `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
|
|
1029
1074
|
* * `metadata.<field_name>` - any field in metadata.value.
|
|
1075
|
+
* `metadata.@type` must be specified first, if filtering on metadata
|
|
1076
|
+
* fields.
|
|
1030
1077
|
* * `error` - Error associated with the long-running operation.
|
|
1031
1078
|
* * `response.@type` - the type of response.
|
|
1032
1079
|
* * `response.<field_name>` - any field in response.value.
|
|
@@ -1130,6 +1177,8 @@ class DatabaseAdminClient {
|
|
|
1130
1177
|
* for {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} is
|
|
1131
1178
|
* `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
|
|
1132
1179
|
* * `metadata.<field_name>` - any field in metadata.value.
|
|
1180
|
+
* `metadata.@type` must be specified first if filtering on metadata
|
|
1181
|
+
* fields.
|
|
1133
1182
|
* * `error` - Error associated with the long-running operation.
|
|
1134
1183
|
* * `response.@type` - the type of response.
|
|
1135
1184
|
* * `response.<field_name>` - any field in response.value.
|
|
@@ -1141,8 +1190,11 @@ class DatabaseAdminClient {
|
|
|
1141
1190
|
* Here are a few examples:
|
|
1142
1191
|
*
|
|
1143
1192
|
* * `done:true` - The operation is complete.
|
|
1144
|
-
* * `metadata.database
|
|
1145
|
-
*
|
|
1193
|
+
* * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
|
|
1194
|
+
* `metadata.database:prod` - Returns operations where:
|
|
1195
|
+
* * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
|
|
1196
|
+
* * The database the backup was taken from has a name containing the
|
|
1197
|
+
* string "prod".
|
|
1146
1198
|
* * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
|
|
1147
1199
|
* `(metadata.name:howl) AND` \
|
|
1148
1200
|
* `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
|
|
@@ -1151,6 +1203,29 @@ class DatabaseAdminClient {
|
|
|
1151
1203
|
* * The backup name contains the string "howl".
|
|
1152
1204
|
* * The operation started before 2018-03-28T14:50:00Z.
|
|
1153
1205
|
* * The operation resulted in an error.
|
|
1206
|
+
* * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \
|
|
1207
|
+
* `(metadata.source_backup:test) AND` \
|
|
1208
|
+
* `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
|
|
1209
|
+
* `(error:*)` - Returns operations where:
|
|
1210
|
+
* * The operation's metadata type is {@link google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}.
|
|
1211
|
+
* * The source backup of the copied backup name contains the string
|
|
1212
|
+
* "test".
|
|
1213
|
+
* * The operation started before 2022-01-18T14:50:00Z.
|
|
1214
|
+
* * The operation resulted in an error.
|
|
1215
|
+
* * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
|
|
1216
|
+
* `(metadata.database:test_db)) OR` \
|
|
1217
|
+
* `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata)
|
|
1218
|
+
* AND` \
|
|
1219
|
+
* `(metadata.source_backup:test_bkp)) AND` \
|
|
1220
|
+
* `(error:*)` - Returns operations where:
|
|
1221
|
+
* * The operation's metadata matches either of criteria:
|
|
1222
|
+
* * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} AND the
|
|
1223
|
+
* database the backup was taken from has name containing string
|
|
1224
|
+
* "test_db"
|
|
1225
|
+
* * The operation's metadata type is {@link google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} AND the
|
|
1226
|
+
* backup the backup was copied from has name containing string
|
|
1227
|
+
* "test_bkp"
|
|
1228
|
+
* * The operation resulted in an error.
|
|
1154
1229
|
* @param {number} request.pageSize
|
|
1155
1230
|
* Number of operations to be returned in the response. If 0 or
|
|
1156
1231
|
* less, defaults to the server's maximum allowed page size.
|
|
@@ -1212,6 +1287,8 @@ class DatabaseAdminClient {
|
|
|
1212
1287
|
* for {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} is
|
|
1213
1288
|
* `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
|
|
1214
1289
|
* * `metadata.<field_name>` - any field in metadata.value.
|
|
1290
|
+
* `metadata.@type` must be specified first if filtering on metadata
|
|
1291
|
+
* fields.
|
|
1215
1292
|
* * `error` - Error associated with the long-running operation.
|
|
1216
1293
|
* * `response.@type` - the type of response.
|
|
1217
1294
|
* * `response.<field_name>` - any field in response.value.
|
|
@@ -1223,8 +1300,11 @@ class DatabaseAdminClient {
|
|
|
1223
1300
|
* Here are a few examples:
|
|
1224
1301
|
*
|
|
1225
1302
|
* * `done:true` - The operation is complete.
|
|
1226
|
-
* * `metadata.database
|
|
1227
|
-
*
|
|
1303
|
+
* * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
|
|
1304
|
+
* `metadata.database:prod` - Returns operations where:
|
|
1305
|
+
* * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
|
|
1306
|
+
* * The database the backup was taken from has a name containing the
|
|
1307
|
+
* string "prod".
|
|
1228
1308
|
* * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
|
|
1229
1309
|
* `(metadata.name:howl) AND` \
|
|
1230
1310
|
* `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
|
|
@@ -1233,6 +1313,29 @@ class DatabaseAdminClient {
|
|
|
1233
1313
|
* * The backup name contains the string "howl".
|
|
1234
1314
|
* * The operation started before 2018-03-28T14:50:00Z.
|
|
1235
1315
|
* * The operation resulted in an error.
|
|
1316
|
+
* * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \
|
|
1317
|
+
* `(metadata.source_backup:test) AND` \
|
|
1318
|
+
* `(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND` \
|
|
1319
|
+
* `(error:*)` - Returns operations where:
|
|
1320
|
+
* * The operation's metadata type is {@link google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata}.
|
|
1321
|
+
* * The source backup of the copied backup name contains the string
|
|
1322
|
+
* "test".
|
|
1323
|
+
* * The operation started before 2022-01-18T14:50:00Z.
|
|
1324
|
+
* * The operation resulted in an error.
|
|
1325
|
+
* * `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
|
|
1326
|
+
* `(metadata.database:test_db)) OR` \
|
|
1327
|
+
* `((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata)
|
|
1328
|
+
* AND` \
|
|
1329
|
+
* `(metadata.source_backup:test_bkp)) AND` \
|
|
1330
|
+
* `(error:*)` - Returns operations where:
|
|
1331
|
+
* * The operation's metadata matches either of criteria:
|
|
1332
|
+
* * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} AND the
|
|
1333
|
+
* database the backup was taken from has name containing string
|
|
1334
|
+
* "test_db"
|
|
1335
|
+
* * The operation's metadata type is {@link google.spanner.admin.database.v1.CopyBackupMetadata|CopyBackupMetadata} AND the
|
|
1336
|
+
* backup the backup was copied from has name containing string
|
|
1337
|
+
* "test_bkp"
|
|
1338
|
+
* * The operation resulted in an error.
|
|
1236
1339
|
* @param {number} request.pageSize
|
|
1237
1340
|
* Number of operations to be returned in the response. If 0 or
|
|
1238
1341
|
* less, defaults to the server's maximum allowed page size.
|
|
@@ -1462,8 +1565,7 @@ class DatabaseAdminClient {
|
|
|
1462
1565
|
* @returns {Promise} A promise that resolves when the client is closed.
|
|
1463
1566
|
*/
|
|
1464
1567
|
close() {
|
|
1465
|
-
this.
|
|
1466
|
-
if (!this._terminated) {
|
|
1568
|
+
if (this.databaseAdminStub && !this._terminated) {
|
|
1467
1569
|
return this.databaseAdminStub.then(stub => {
|
|
1468
1570
|
this._terminated = true;
|
|
1469
1571
|
stub.close();
|
|
@@ -79,6 +79,11 @@
|
|
|
79
79
|
"retry_codes_name": "non_idempotent",
|
|
80
80
|
"retry_params_name": "default"
|
|
81
81
|
},
|
|
82
|
+
"CopyBackup": {
|
|
83
|
+
"timeout_millis": 3600000,
|
|
84
|
+
"retry_codes_name": "non_idempotent",
|
|
85
|
+
"retry_params_name": "default"
|
|
86
|
+
},
|
|
82
87
|
"GetBackup": {
|
|
83
88
|
"timeout_millis": 3600000,
|
|
84
89
|
"retry_codes_name": "idempotent",
|
package/build/src/v1/index.js
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
// ** https://github.com/googleapis/gapic-generator-typescript **
|
|
18
18
|
// ** All changes to this file may be overwritten. **
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.InstanceAdminClient = exports.DatabaseAdminClient = exports.SpannerClient = void 0;
|
|
20
21
|
var spanner_client_1 = require("./spanner_client");
|
|
21
22
|
Object.defineProperty(exports, "SpannerClient", { enumerable: true, get: function () { return spanner_client_1.SpannerClient; } });
|
|
22
23
|
var database_admin_client_1 = require("./database_admin_client");
|
|
@@ -140,7 +140,11 @@ export declare class InstanceAdminClient {
|
|
|
140
140
|
* @example <caption>include:samples/generated/v1/instance_admin.get_instance_config.js</caption>
|
|
141
141
|
* region_tag:spanner_v1_generated_InstanceAdmin_GetInstanceConfig_async
|
|
142
142
|
*/
|
|
143
|
-
getInstanceConfig(request?: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, options?: CallOptions): Promise<[
|
|
143
|
+
getInstanceConfig(request?: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, options?: CallOptions): Promise<[
|
|
144
|
+
protos.google.spanner.admin.instance.v1.IInstanceConfig,
|
|
145
|
+
(protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest | undefined),
|
|
146
|
+
{} | undefined
|
|
147
|
+
]>;
|
|
144
148
|
getInstanceConfig(request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.instance.v1.IInstanceConfig, protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest | null | undefined, {} | null | undefined>): void;
|
|
145
149
|
getInstanceConfig(request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, callback: Callback<protos.google.spanner.admin.instance.v1.IInstanceConfig, protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest | null | undefined, {} | null | undefined>): void;
|
|
146
150
|
/**
|
|
@@ -165,7 +169,11 @@ export declare class InstanceAdminClient {
|
|
|
165
169
|
* @example <caption>include:samples/generated/v1/instance_admin.get_instance.js</caption>
|
|
166
170
|
* region_tag:spanner_v1_generated_InstanceAdmin_GetInstance_async
|
|
167
171
|
*/
|
|
168
|
-
getInstance(request?: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, options?: CallOptions): Promise<[
|
|
172
|
+
getInstance(request?: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, options?: CallOptions): Promise<[
|
|
173
|
+
protos.google.spanner.admin.instance.v1.IInstance,
|
|
174
|
+
protos.google.spanner.admin.instance.v1.IGetInstanceRequest | undefined,
|
|
175
|
+
{} | undefined
|
|
176
|
+
]>;
|
|
169
177
|
getInstance(request: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IGetInstanceRequest | null | undefined, {} | null | undefined>): void;
|
|
170
178
|
getInstance(request: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, callback: Callback<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IGetInstanceRequest | null | undefined, {} | null | undefined>): void;
|
|
171
179
|
/**
|
|
@@ -196,7 +204,11 @@ export declare class InstanceAdminClient {
|
|
|
196
204
|
* @example <caption>include:samples/generated/v1/instance_admin.delete_instance.js</caption>
|
|
197
205
|
* region_tag:spanner_v1_generated_InstanceAdmin_DeleteInstance_async
|
|
198
206
|
*/
|
|
199
|
-
deleteInstance(request?: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, options?: CallOptions): Promise<[
|
|
207
|
+
deleteInstance(request?: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, options?: CallOptions): Promise<[
|
|
208
|
+
protos.google.protobuf.IEmpty,
|
|
209
|
+
(protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest | undefined),
|
|
210
|
+
{} | undefined
|
|
211
|
+
]>;
|
|
200
212
|
deleteInstance(request: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest | null | undefined, {} | null | undefined>): void;
|
|
201
213
|
deleteInstance(request: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest | null | undefined, {} | null | undefined>): void;
|
|
202
214
|
/**
|
|
@@ -216,6 +228,12 @@ export declare class InstanceAdminClient {
|
|
|
216
228
|
* the policy is limited to a few 10s of KB. An empty policy is a
|
|
217
229
|
* valid policy but certain Cloud Platform services (such as Projects)
|
|
218
230
|
* might reject them.
|
|
231
|
+
* @param {google.protobuf.FieldMask} request.updateMask
|
|
232
|
+
* OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
|
|
233
|
+
* the fields in the mask will be modified. If no mask is provided, the
|
|
234
|
+
* following default mask is used:
|
|
235
|
+
*
|
|
236
|
+
* `paths: "bindings, etag"`
|
|
219
237
|
* @param {object} [options]
|
|
220
238
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
221
239
|
* @returns {Promise} - The promise which resolves to an array.
|
|
@@ -226,7 +244,11 @@ export declare class InstanceAdminClient {
|
|
|
226
244
|
* @example <caption>include:samples/generated/v1/instance_admin.set_iam_policy.js</caption>
|
|
227
245
|
* region_tag:spanner_v1_generated_InstanceAdmin_SetIamPolicy_async
|
|
228
246
|
*/
|
|
229
|
-
setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
|
|
247
|
+
setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
|
|
248
|
+
protos.google.iam.v1.IPolicy,
|
|
249
|
+
protos.google.iam.v1.ISetIamPolicyRequest | undefined,
|
|
250
|
+
{} | undefined
|
|
251
|
+
]>;
|
|
230
252
|
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
|
|
231
253
|
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
|
|
232
254
|
/**
|
|
@@ -243,7 +265,7 @@ export declare class InstanceAdminClient {
|
|
|
243
265
|
* See the operation documentation for the appropriate value for this field.
|
|
244
266
|
* @param {google.iam.v1.GetPolicyOptions} request.options
|
|
245
267
|
* OPTIONAL: A `GetPolicyOptions` object for specifying options to
|
|
246
|
-
* `GetIamPolicy`.
|
|
268
|
+
* `GetIamPolicy`.
|
|
247
269
|
* @param {object} [options]
|
|
248
270
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
249
271
|
* @returns {Promise} - The promise which resolves to an array.
|
|
@@ -254,7 +276,11 @@ export declare class InstanceAdminClient {
|
|
|
254
276
|
* @example <caption>include:samples/generated/v1/instance_admin.get_iam_policy.js</caption>
|
|
255
277
|
* region_tag:spanner_v1_generated_InstanceAdmin_GetIamPolicy_async
|
|
256
278
|
*/
|
|
257
|
-
getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
|
|
279
|
+
getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
|
|
280
|
+
protos.google.iam.v1.IPolicy,
|
|
281
|
+
protos.google.iam.v1.IGetIamPolicyRequest | undefined,
|
|
282
|
+
{} | undefined
|
|
283
|
+
]>;
|
|
258
284
|
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
|
|
259
285
|
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
|
|
260
286
|
/**
|
|
@@ -285,7 +311,11 @@ export declare class InstanceAdminClient {
|
|
|
285
311
|
* @example <caption>include:samples/generated/v1/instance_admin.test_iam_permissions.js</caption>
|
|
286
312
|
* region_tag:spanner_v1_generated_InstanceAdmin_TestIamPermissions_async
|
|
287
313
|
*/
|
|
288
|
-
testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
|
|
314
|
+
testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
|
|
315
|
+
protos.google.iam.v1.ITestIamPermissionsResponse,
|
|
316
|
+
protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
|
|
317
|
+
{} | undefined
|
|
318
|
+
]>;
|
|
289
319
|
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
|
|
290
320
|
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
|
|
291
321
|
/**
|
|
@@ -348,7 +378,11 @@ export declare class InstanceAdminClient {
|
|
|
348
378
|
* @example <caption>include:samples/generated/v1/instance_admin.create_instance.js</caption>
|
|
349
379
|
* region_tag:spanner_v1_generated_InstanceAdmin_CreateInstance_async
|
|
350
380
|
*/
|
|
351
|
-
createInstance(request?: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, options?: CallOptions): Promise<[
|
|
381
|
+
createInstance(request?: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, options?: CallOptions): Promise<[
|
|
382
|
+
LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.ICreateInstanceMetadata>,
|
|
383
|
+
protos.google.longrunning.IOperation | undefined,
|
|
384
|
+
{} | undefined
|
|
385
|
+
]>;
|
|
352
386
|
createInstance(request: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.ICreateInstanceMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
|
353
387
|
createInstance(request: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, callback: Callback<LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.ICreateInstanceMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
|
354
388
|
/**
|
|
@@ -428,7 +462,11 @@ export declare class InstanceAdminClient {
|
|
|
428
462
|
* @example <caption>include:samples/generated/v1/instance_admin.update_instance.js</caption>
|
|
429
463
|
* region_tag:spanner_v1_generated_InstanceAdmin_UpdateInstance_async
|
|
430
464
|
*/
|
|
431
|
-
updateInstance(request?: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, options?: CallOptions): Promise<[
|
|
465
|
+
updateInstance(request?: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, options?: CallOptions): Promise<[
|
|
466
|
+
LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IUpdateInstanceMetadata>,
|
|
467
|
+
protos.google.longrunning.IOperation | undefined,
|
|
468
|
+
{} | undefined
|
|
469
|
+
]>;
|
|
432
470
|
updateInstance(request: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IUpdateInstanceMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
|
433
471
|
updateInstance(request: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, callback: Callback<LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IUpdateInstanceMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
|
434
472
|
/**
|
|
@@ -473,7 +511,11 @@ export declare class InstanceAdminClient {
|
|
|
473
511
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
474
512
|
* for more details and examples.
|
|
475
513
|
*/
|
|
476
|
-
listInstanceConfigs(request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, options?: CallOptions): Promise<[
|
|
514
|
+
listInstanceConfigs(request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, options?: CallOptions): Promise<[
|
|
515
|
+
protos.google.spanner.admin.instance.v1.IInstanceConfig[],
|
|
516
|
+
protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest | null,
|
|
517
|
+
protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse
|
|
518
|
+
]>;
|
|
477
519
|
listInstanceConfigs(request: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse | null | undefined, protos.google.spanner.admin.instance.v1.IInstanceConfig>): void;
|
|
478
520
|
listInstanceConfigs(request: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, callback: PaginationCallback<protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse | null | undefined, protos.google.spanner.admin.instance.v1.IInstanceConfig>): void;
|
|
479
521
|
/**
|
|
@@ -583,7 +625,11 @@ export declare class InstanceAdminClient {
|
|
|
583
625
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
584
626
|
* for more details and examples.
|
|
585
627
|
*/
|
|
586
|
-
listInstances(request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, options?: CallOptions): Promise<[
|
|
628
|
+
listInstances(request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, options?: CallOptions): Promise<[
|
|
629
|
+
protos.google.spanner.admin.instance.v1.IInstance[],
|
|
630
|
+
protos.google.spanner.admin.instance.v1.IListInstancesRequest | null,
|
|
631
|
+
protos.google.spanner.admin.instance.v1.IListInstancesResponse
|
|
632
|
+
]>;
|
|
587
633
|
listInstances(request: protos.google.spanner.admin.instance.v1.IListInstancesRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.instance.v1.IListInstancesRequest, protos.google.spanner.admin.instance.v1.IListInstancesResponse | null | undefined, protos.google.spanner.admin.instance.v1.IInstance>): void;
|
|
588
634
|
listInstances(request: protos.google.spanner.admin.instance.v1.IListInstancesRequest, callback: PaginationCallback<protos.google.spanner.admin.instance.v1.IListInstancesRequest, protos.google.spanner.admin.instance.v1.IListInstancesResponse | null | undefined, protos.google.spanner.admin.instance.v1.IInstance>): void;
|
|
589
635
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2022 Google LLC
|
|
3
3
|
//
|
|
4
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -826,8 +826,7 @@ class InstanceAdminClient {
|
|
|
826
826
|
* @returns {Promise} A promise that resolves when the client is closed.
|
|
827
827
|
*/
|
|
828
828
|
close() {
|
|
829
|
-
this.
|
|
830
|
-
if (!this._terminated) {
|
|
829
|
+
if (this.instanceAdminStub && !this._terminated) {
|
|
831
830
|
return this.instanceAdminStub.then(stub => {
|
|
832
831
|
this._terminated = true;
|
|
833
832
|
stub.close();
|