@google-cloud/spanner 6.1.3 → 6.2.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 +28 -0
- package/README.md +6 -1
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +60 -0
- package/build/protos/google/spanner/admin/instance/v1/common.proto +42 -0
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +494 -41
- package/build/protos/google/spanner/v1/type.proto +8 -0
- package/build/protos/protos.d.ts +3060 -475
- package/build/protos/protos.js +10009 -3309
- package/build/protos/protos.json +406 -6
- package/build/src/v1/database_admin_client.d.ts +269 -3
- package/build/src/v1/database_admin_client.js +431 -81
- package/build/src/v1/database_admin_client_config.json +5 -0
- package/build/src/v1/gapic_metadata.json +44 -0
- package/build/src/v1/instance_admin_client.d.ts +514 -22
- package/build/src/v1/instance_admin_client.js +379 -45
- package/build/src/v1/instance_admin_client_config.json +16 -0
- package/build/src/v1/instance_admin_proto_list.json +1 -0
- package/build/src/v1/spanner_client.d.ts +10 -3
- package/build/src/v1/spanner_client.js +69 -44
- package/package.json +11 -11
|
@@ -18,8 +18,6 @@
|
|
|
18
18
|
// ** All changes to this file may be overwritten. **
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.DatabaseAdminClient = void 0;
|
|
21
|
-
/* global window */
|
|
22
|
-
const gax = require("google-gax");
|
|
23
21
|
const jsonProtos = require("../../protos/protos.json");
|
|
24
22
|
/**
|
|
25
23
|
* Client JSON configuration object, loaded from
|
|
@@ -27,7 +25,6 @@ const jsonProtos = require("../../protos/protos.json");
|
|
|
27
25
|
* This file defines retry strategy and timeouts for all API methods in this library.
|
|
28
26
|
*/
|
|
29
27
|
const gapicConfig = require("./database_admin_client_config.json");
|
|
30
|
-
const google_gax_1 = require("google-gax");
|
|
31
28
|
const version = require('../../../package.json').version;
|
|
32
29
|
/**
|
|
33
30
|
* Cloud Spanner Database Admin API
|
|
@@ -73,8 +70,15 @@ class DatabaseAdminClient {
|
|
|
73
70
|
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
|
74
71
|
* For more information, please check the
|
|
75
72
|
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
73
|
+
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
|
|
74
|
+
* need to avoid loading the default gRPC version and want to use the fallback
|
|
75
|
+
* HTTP implementation. Load only fallback version and pass it to the constructor:
|
|
76
|
+
* ```
|
|
77
|
+
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
|
|
78
|
+
* const client = new DatabaseAdminClient({fallback: 'rest'}, gax);
|
|
79
|
+
* ```
|
|
76
80
|
*/
|
|
77
|
-
constructor(opts) {
|
|
81
|
+
constructor(opts, gaxInstance) {
|
|
78
82
|
var _a, _b;
|
|
79
83
|
this._terminated = false;
|
|
80
84
|
this.descriptors = {
|
|
@@ -95,8 +99,12 @@ class DatabaseAdminClient {
|
|
|
95
99
|
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
|
|
96
100
|
opts['scopes'] = staticMembers.scopes;
|
|
97
101
|
}
|
|
102
|
+
// Load google-gax module synchronously if needed
|
|
103
|
+
if (!gaxInstance) {
|
|
104
|
+
gaxInstance = require('google-gax');
|
|
105
|
+
}
|
|
98
106
|
// Choose either gRPC or proto-over-HTTP implementation of google-gax.
|
|
99
|
-
this._gaxModule = opts.fallback ?
|
|
107
|
+
this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
|
|
100
108
|
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
|
|
101
109
|
this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
|
|
102
110
|
// Save options to use in initialize() method.
|
|
@@ -137,6 +145,7 @@ class DatabaseAdminClient {
|
|
|
137
145
|
backupPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/backups/{backup}'),
|
|
138
146
|
cryptoKeyPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}'),
|
|
139
147
|
databasePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}'),
|
|
148
|
+
databaseRolePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}/databases/{database}/databaseRoles/{role}'),
|
|
140
149
|
instancePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/instances/{instance}'),
|
|
141
150
|
};
|
|
142
151
|
// Some of the methods on this service return "paged" results,
|
|
@@ -147,6 +156,7 @@ class DatabaseAdminClient {
|
|
|
147
156
|
listBackups: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'),
|
|
148
157
|
listDatabaseOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
|
|
149
158
|
listBackupOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
|
|
159
|
+
listDatabaseRoles: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databaseRoles'),
|
|
150
160
|
};
|
|
151
161
|
const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
152
162
|
// This API contains "long-running operations", which return a
|
|
@@ -160,31 +170,45 @@ class DatabaseAdminClient {
|
|
|
160
170
|
lroOptions.protoJson = protoFilesRoot;
|
|
161
171
|
lroOptions.httpRules = [
|
|
162
172
|
{
|
|
163
|
-
selector: 'google.longrunning.Operations.
|
|
164
|
-
|
|
173
|
+
selector: 'google.longrunning.Operations.CancelOperation',
|
|
174
|
+
post: '/v1/{name=projects/*/instances/*/databases/*/operations/*}:cancel',
|
|
165
175
|
additional_bindings: [
|
|
166
|
-
{
|
|
176
|
+
{ post: '/v1/{name=projects/*/instances/*/operations/*}:cancel' },
|
|
177
|
+
{
|
|
178
|
+
post: '/v1/{name=projects/*/instances/*/backups/*/operations/*}:cancel',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
post: '/v1/{name=projects/*/instanceConfigs/*/operations/*}:cancel',
|
|
182
|
+
},
|
|
167
183
|
],
|
|
168
184
|
},
|
|
169
185
|
{
|
|
170
|
-
selector: 'google.longrunning.Operations.
|
|
171
|
-
|
|
186
|
+
selector: 'google.longrunning.Operations.DeleteOperation',
|
|
187
|
+
delete: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
|
|
172
188
|
additional_bindings: [
|
|
173
|
-
{
|
|
189
|
+
{ delete: '/v1/{name=projects/*/instances/*/operations/*}' },
|
|
190
|
+
{
|
|
191
|
+
delete: '/v1/{name=projects/*/instances/*/backups/*/operations/*}',
|
|
192
|
+
},
|
|
193
|
+
{ delete: '/v1/{name=projects/*/instanceConfigs/*/operations/*}' },
|
|
174
194
|
],
|
|
175
195
|
},
|
|
176
196
|
{
|
|
177
|
-
selector: 'google.longrunning.Operations.
|
|
178
|
-
|
|
197
|
+
selector: 'google.longrunning.Operations.GetOperation',
|
|
198
|
+
get: '/v1/{name=projects/*/instances/*/databases/*/operations/*}',
|
|
179
199
|
additional_bindings: [
|
|
180
|
-
{
|
|
200
|
+
{ get: '/v1/{name=projects/*/instances/*/operations/*}' },
|
|
201
|
+
{ get: '/v1/{name=projects/*/instances/*/backups/*/operations/*}' },
|
|
202
|
+
{ get: '/v1/{name=projects/*/instanceConfigs/*/operations/*}' },
|
|
181
203
|
],
|
|
182
204
|
},
|
|
183
205
|
{
|
|
184
|
-
selector: 'google.longrunning.Operations.
|
|
185
|
-
|
|
206
|
+
selector: 'google.longrunning.Operations.ListOperations',
|
|
207
|
+
get: '/v1/{name=projects/*/instances/*/databases/*/operations}',
|
|
186
208
|
additional_bindings: [
|
|
187
|
-
{
|
|
209
|
+
{ get: '/v1/{name=projects/*/instances/*/operations}' },
|
|
210
|
+
{ get: '/v1/{name=projects/*/instances/*/backups/*/operations}' },
|
|
211
|
+
{ get: '/v1/{name=projects/*/instanceConfigs/*/operations}' },
|
|
188
212
|
],
|
|
189
213
|
},
|
|
190
214
|
];
|
|
@@ -216,7 +240,7 @@ class DatabaseAdminClient {
|
|
|
216
240
|
// merely providing the destination and request information.
|
|
217
241
|
this.innerApiCalls = {};
|
|
218
242
|
// Add a warn function to the client constructor so it can be easily tested.
|
|
219
|
-
this.warn =
|
|
243
|
+
this.warn = this._gaxModule.warn;
|
|
220
244
|
}
|
|
221
245
|
/**
|
|
222
246
|
* Initialize the client.
|
|
@@ -261,6 +285,7 @@ class DatabaseAdminClient {
|
|
|
261
285
|
'restoreDatabase',
|
|
262
286
|
'listDatabaseOperations',
|
|
263
287
|
'listBackupOperations',
|
|
288
|
+
'listDatabaseRoles',
|
|
264
289
|
];
|
|
265
290
|
for (const methodName of databaseAdminStubMethods) {
|
|
266
291
|
const callPromise = this.databaseAdminStub.then(stub => (...args) => {
|
|
@@ -275,7 +300,7 @@ class DatabaseAdminClient {
|
|
|
275
300
|
const descriptor = this.descriptors.page[methodName] ||
|
|
276
301
|
this.descriptors.longrunning[methodName] ||
|
|
277
302
|
undefined;
|
|
278
|
-
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor);
|
|
303
|
+
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
|
|
279
304
|
this.innerApiCalls[methodName] = apiCall;
|
|
280
305
|
}
|
|
281
306
|
return this.databaseAdminStub;
|
|
@@ -325,6 +350,7 @@ class DatabaseAdminClient {
|
|
|
325
350
|
return this.auth.getProjectId();
|
|
326
351
|
}
|
|
327
352
|
getDatabase(request, optionsOrCallback, callback) {
|
|
353
|
+
var _a;
|
|
328
354
|
request = request || {};
|
|
329
355
|
let options;
|
|
330
356
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -338,13 +364,14 @@ class DatabaseAdminClient {
|
|
|
338
364
|
options.otherArgs = options.otherArgs || {};
|
|
339
365
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
340
366
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
341
|
-
|
|
342
|
-
name: request.name
|
|
367
|
+
this._gaxModule.routingHeader.fromParams({
|
|
368
|
+
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
|
|
343
369
|
});
|
|
344
370
|
this.initialize();
|
|
345
371
|
return this.innerApiCalls.getDatabase(request, options, callback);
|
|
346
372
|
}
|
|
347
373
|
dropDatabase(request, optionsOrCallback, callback) {
|
|
374
|
+
var _a;
|
|
348
375
|
request = request || {};
|
|
349
376
|
let options;
|
|
350
377
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -358,13 +385,14 @@ class DatabaseAdminClient {
|
|
|
358
385
|
options.otherArgs = options.otherArgs || {};
|
|
359
386
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
360
387
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
361
|
-
|
|
362
|
-
database: request.database
|
|
388
|
+
this._gaxModule.routingHeader.fromParams({
|
|
389
|
+
database: (_a = request.database) !== null && _a !== void 0 ? _a : '',
|
|
363
390
|
});
|
|
364
391
|
this.initialize();
|
|
365
392
|
return this.innerApiCalls.dropDatabase(request, options, callback);
|
|
366
393
|
}
|
|
367
394
|
getDatabaseDdl(request, optionsOrCallback, callback) {
|
|
395
|
+
var _a;
|
|
368
396
|
request = request || {};
|
|
369
397
|
let options;
|
|
370
398
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -378,13 +406,14 @@ class DatabaseAdminClient {
|
|
|
378
406
|
options.otherArgs = options.otherArgs || {};
|
|
379
407
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
380
408
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
381
|
-
|
|
382
|
-
database: request.database
|
|
409
|
+
this._gaxModule.routingHeader.fromParams({
|
|
410
|
+
database: (_a = request.database) !== null && _a !== void 0 ? _a : '',
|
|
383
411
|
});
|
|
384
412
|
this.initialize();
|
|
385
413
|
return this.innerApiCalls.getDatabaseDdl(request, options, callback);
|
|
386
414
|
}
|
|
387
415
|
setIamPolicy(request, optionsOrCallback, callback) {
|
|
416
|
+
var _a;
|
|
388
417
|
request = request || {};
|
|
389
418
|
let options;
|
|
390
419
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -398,13 +427,14 @@ class DatabaseAdminClient {
|
|
|
398
427
|
options.otherArgs = options.otherArgs || {};
|
|
399
428
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
400
429
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
401
|
-
|
|
402
|
-
resource: request.resource
|
|
430
|
+
this._gaxModule.routingHeader.fromParams({
|
|
431
|
+
resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
|
|
403
432
|
});
|
|
404
433
|
this.initialize();
|
|
405
434
|
return this.innerApiCalls.setIamPolicy(request, options, callback);
|
|
406
435
|
}
|
|
407
436
|
getIamPolicy(request, optionsOrCallback, callback) {
|
|
437
|
+
var _a;
|
|
408
438
|
request = request || {};
|
|
409
439
|
let options;
|
|
410
440
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -418,13 +448,14 @@ class DatabaseAdminClient {
|
|
|
418
448
|
options.otherArgs = options.otherArgs || {};
|
|
419
449
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
420
450
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
421
|
-
|
|
422
|
-
resource: request.resource
|
|
451
|
+
this._gaxModule.routingHeader.fromParams({
|
|
452
|
+
resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
|
|
423
453
|
});
|
|
424
454
|
this.initialize();
|
|
425
455
|
return this.innerApiCalls.getIamPolicy(request, options, callback);
|
|
426
456
|
}
|
|
427
457
|
testIamPermissions(request, optionsOrCallback, callback) {
|
|
458
|
+
var _a;
|
|
428
459
|
request = request || {};
|
|
429
460
|
let options;
|
|
430
461
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -438,13 +469,14 @@ class DatabaseAdminClient {
|
|
|
438
469
|
options.otherArgs = options.otherArgs || {};
|
|
439
470
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
440
471
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
441
|
-
|
|
442
|
-
resource: request.resource
|
|
472
|
+
this._gaxModule.routingHeader.fromParams({
|
|
473
|
+
resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
|
|
443
474
|
});
|
|
444
475
|
this.initialize();
|
|
445
476
|
return this.innerApiCalls.testIamPermissions(request, options, callback);
|
|
446
477
|
}
|
|
447
478
|
getBackup(request, optionsOrCallback, callback) {
|
|
479
|
+
var _a;
|
|
448
480
|
request = request || {};
|
|
449
481
|
let options;
|
|
450
482
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -458,13 +490,14 @@ class DatabaseAdminClient {
|
|
|
458
490
|
options.otherArgs = options.otherArgs || {};
|
|
459
491
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
460
492
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
461
|
-
|
|
462
|
-
name: request.name
|
|
493
|
+
this._gaxModule.routingHeader.fromParams({
|
|
494
|
+
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
|
|
463
495
|
});
|
|
464
496
|
this.initialize();
|
|
465
497
|
return this.innerApiCalls.getBackup(request, options, callback);
|
|
466
498
|
}
|
|
467
499
|
updateBackup(request, optionsOrCallback, callback) {
|
|
500
|
+
var _a;
|
|
468
501
|
request = request || {};
|
|
469
502
|
let options;
|
|
470
503
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -478,13 +511,14 @@ class DatabaseAdminClient {
|
|
|
478
511
|
options.otherArgs = options.otherArgs || {};
|
|
479
512
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
480
513
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
481
|
-
|
|
482
|
-
'backup.name': request.backup.name
|
|
514
|
+
this._gaxModule.routingHeader.fromParams({
|
|
515
|
+
'backup.name': (_a = request.backup.name) !== null && _a !== void 0 ? _a : '',
|
|
483
516
|
});
|
|
484
517
|
this.initialize();
|
|
485
518
|
return this.innerApiCalls.updateBackup(request, options, callback);
|
|
486
519
|
}
|
|
487
520
|
deleteBackup(request, optionsOrCallback, callback) {
|
|
521
|
+
var _a;
|
|
488
522
|
request = request || {};
|
|
489
523
|
let options;
|
|
490
524
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -498,13 +532,14 @@ class DatabaseAdminClient {
|
|
|
498
532
|
options.otherArgs = options.otherArgs || {};
|
|
499
533
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
500
534
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
501
|
-
|
|
502
|
-
name: request.name
|
|
535
|
+
this._gaxModule.routingHeader.fromParams({
|
|
536
|
+
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
|
|
503
537
|
});
|
|
504
538
|
this.initialize();
|
|
505
539
|
return this.innerApiCalls.deleteBackup(request, options, callback);
|
|
506
540
|
}
|
|
507
541
|
createDatabase(request, optionsOrCallback, callback) {
|
|
542
|
+
var _a;
|
|
508
543
|
request = request || {};
|
|
509
544
|
let options;
|
|
510
545
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -518,8 +553,8 @@ class DatabaseAdminClient {
|
|
|
518
553
|
options.otherArgs = options.otherArgs || {};
|
|
519
554
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
520
555
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
521
|
-
|
|
522
|
-
parent: request.parent
|
|
556
|
+
this._gaxModule.routingHeader.fromParams({
|
|
557
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
523
558
|
});
|
|
524
559
|
this.initialize();
|
|
525
560
|
return this.innerApiCalls.createDatabase(request, options, callback);
|
|
@@ -537,12 +572,13 @@ class DatabaseAdminClient {
|
|
|
537
572
|
* region_tag:spanner_v1_generated_DatabaseAdmin_CreateDatabase_async
|
|
538
573
|
*/
|
|
539
574
|
async checkCreateDatabaseProgress(name) {
|
|
540
|
-
const request = new
|
|
575
|
+
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
541
576
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
542
|
-
const decodeOperation = new
|
|
577
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDatabase, this._gaxModule.createDefaultBackoffSettings());
|
|
543
578
|
return decodeOperation;
|
|
544
579
|
}
|
|
545
580
|
updateDatabaseDdl(request, optionsOrCallback, callback) {
|
|
581
|
+
var _a;
|
|
546
582
|
request = request || {};
|
|
547
583
|
let options;
|
|
548
584
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -556,8 +592,8 @@ class DatabaseAdminClient {
|
|
|
556
592
|
options.otherArgs = options.otherArgs || {};
|
|
557
593
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
558
594
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
559
|
-
|
|
560
|
-
database: request.database
|
|
595
|
+
this._gaxModule.routingHeader.fromParams({
|
|
596
|
+
database: (_a = request.database) !== null && _a !== void 0 ? _a : '',
|
|
561
597
|
});
|
|
562
598
|
this.initialize();
|
|
563
599
|
return this.innerApiCalls.updateDatabaseDdl(request, options, callback);
|
|
@@ -575,12 +611,13 @@ class DatabaseAdminClient {
|
|
|
575
611
|
* region_tag:spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_async
|
|
576
612
|
*/
|
|
577
613
|
async checkUpdateDatabaseDdlProgress(name) {
|
|
578
|
-
const request = new
|
|
614
|
+
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
579
615
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
580
|
-
const decodeOperation = new
|
|
616
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateDatabaseDdl, this._gaxModule.createDefaultBackoffSettings());
|
|
581
617
|
return decodeOperation;
|
|
582
618
|
}
|
|
583
619
|
createBackup(request, optionsOrCallback, callback) {
|
|
620
|
+
var _a;
|
|
584
621
|
request = request || {};
|
|
585
622
|
let options;
|
|
586
623
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -594,8 +631,8 @@ class DatabaseAdminClient {
|
|
|
594
631
|
options.otherArgs = options.otherArgs || {};
|
|
595
632
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
596
633
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
597
|
-
|
|
598
|
-
parent: request.parent
|
|
634
|
+
this._gaxModule.routingHeader.fromParams({
|
|
635
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
599
636
|
});
|
|
600
637
|
this.initialize();
|
|
601
638
|
return this.innerApiCalls.createBackup(request, options, callback);
|
|
@@ -613,12 +650,13 @@ class DatabaseAdminClient {
|
|
|
613
650
|
* region_tag:spanner_v1_generated_DatabaseAdmin_CreateBackup_async
|
|
614
651
|
*/
|
|
615
652
|
async checkCreateBackupProgress(name) {
|
|
616
|
-
const request = new
|
|
653
|
+
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
617
654
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
618
|
-
const decodeOperation = new
|
|
655
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings());
|
|
619
656
|
return decodeOperation;
|
|
620
657
|
}
|
|
621
658
|
copyBackup(request, optionsOrCallback, callback) {
|
|
659
|
+
var _a;
|
|
622
660
|
request = request || {};
|
|
623
661
|
let options;
|
|
624
662
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -632,8 +670,8 @@ class DatabaseAdminClient {
|
|
|
632
670
|
options.otherArgs = options.otherArgs || {};
|
|
633
671
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
634
672
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
635
|
-
|
|
636
|
-
parent: request.parent
|
|
673
|
+
this._gaxModule.routingHeader.fromParams({
|
|
674
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
637
675
|
});
|
|
638
676
|
this.initialize();
|
|
639
677
|
return this.innerApiCalls.copyBackup(request, options, callback);
|
|
@@ -651,12 +689,13 @@ class DatabaseAdminClient {
|
|
|
651
689
|
* region_tag:spanner_v1_generated_DatabaseAdmin_CopyBackup_async
|
|
652
690
|
*/
|
|
653
691
|
async checkCopyBackupProgress(name) {
|
|
654
|
-
const request = new
|
|
692
|
+
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
655
693
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
656
|
-
const decodeOperation = new
|
|
694
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.copyBackup, this._gaxModule.createDefaultBackoffSettings());
|
|
657
695
|
return decodeOperation;
|
|
658
696
|
}
|
|
659
697
|
restoreDatabase(request, optionsOrCallback, callback) {
|
|
698
|
+
var _a;
|
|
660
699
|
request = request || {};
|
|
661
700
|
let options;
|
|
662
701
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -670,8 +709,8 @@ class DatabaseAdminClient {
|
|
|
670
709
|
options.otherArgs = options.otherArgs || {};
|
|
671
710
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
672
711
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
673
|
-
|
|
674
|
-
parent: request.parent
|
|
712
|
+
this._gaxModule.routingHeader.fromParams({
|
|
713
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
675
714
|
});
|
|
676
715
|
this.initialize();
|
|
677
716
|
return this.innerApiCalls.restoreDatabase(request, options, callback);
|
|
@@ -689,12 +728,13 @@ class DatabaseAdminClient {
|
|
|
689
728
|
* region_tag:spanner_v1_generated_DatabaseAdmin_RestoreDatabase_async
|
|
690
729
|
*/
|
|
691
730
|
async checkRestoreDatabaseProgress(name) {
|
|
692
|
-
const request = new
|
|
731
|
+
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
693
732
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
694
|
-
const decodeOperation = new
|
|
733
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreDatabase, this._gaxModule.createDefaultBackoffSettings());
|
|
695
734
|
return decodeOperation;
|
|
696
735
|
}
|
|
697
736
|
listDatabases(request, optionsOrCallback, callback) {
|
|
737
|
+
var _a;
|
|
698
738
|
request = request || {};
|
|
699
739
|
let options;
|
|
700
740
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -708,8 +748,8 @@ class DatabaseAdminClient {
|
|
|
708
748
|
options.otherArgs = options.otherArgs || {};
|
|
709
749
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
710
750
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
711
|
-
|
|
712
|
-
parent: request.parent
|
|
751
|
+
this._gaxModule.routingHeader.fromParams({
|
|
752
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
713
753
|
});
|
|
714
754
|
this.initialize();
|
|
715
755
|
return this.innerApiCalls.listDatabases(request, options, callback);
|
|
@@ -741,13 +781,14 @@ class DatabaseAdminClient {
|
|
|
741
781
|
* for more details and examples.
|
|
742
782
|
*/
|
|
743
783
|
listDatabasesStream(request, options) {
|
|
784
|
+
var _a;
|
|
744
785
|
request = request || {};
|
|
745
786
|
options = options || {};
|
|
746
787
|
options.otherArgs = options.otherArgs || {};
|
|
747
788
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
748
789
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
749
|
-
|
|
750
|
-
parent: request.parent
|
|
790
|
+
this._gaxModule.routingHeader.fromParams({
|
|
791
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
751
792
|
});
|
|
752
793
|
const defaultCallSettings = this._defaults['listDatabases'];
|
|
753
794
|
const callSettings = defaultCallSettings.merge(options);
|
|
@@ -784,13 +825,14 @@ class DatabaseAdminClient {
|
|
|
784
825
|
* region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabases_async
|
|
785
826
|
*/
|
|
786
827
|
listDatabasesAsync(request, options) {
|
|
828
|
+
var _a;
|
|
787
829
|
request = request || {};
|
|
788
830
|
options = options || {};
|
|
789
831
|
options.otherArgs = options.otherArgs || {};
|
|
790
832
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
791
833
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
792
|
-
|
|
793
|
-
parent: request.parent
|
|
834
|
+
this._gaxModule.routingHeader.fromParams({
|
|
835
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
794
836
|
});
|
|
795
837
|
const defaultCallSettings = this._defaults['listDatabases'];
|
|
796
838
|
const callSettings = defaultCallSettings.merge(options);
|
|
@@ -798,6 +840,7 @@ class DatabaseAdminClient {
|
|
|
798
840
|
return this.descriptors.page.listDatabases.asyncIterate(this.innerApiCalls['listDatabases'], request, callSettings);
|
|
799
841
|
}
|
|
800
842
|
listBackups(request, optionsOrCallback, callback) {
|
|
843
|
+
var _a;
|
|
801
844
|
request = request || {};
|
|
802
845
|
let options;
|
|
803
846
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -811,8 +854,8 @@ class DatabaseAdminClient {
|
|
|
811
854
|
options.otherArgs = options.otherArgs || {};
|
|
812
855
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
813
856
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
814
|
-
|
|
815
|
-
parent: request.parent
|
|
857
|
+
this._gaxModule.routingHeader.fromParams({
|
|
858
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
816
859
|
});
|
|
817
860
|
this.initialize();
|
|
818
861
|
return this.innerApiCalls.listBackups(request, options, callback);
|
|
@@ -881,13 +924,14 @@ class DatabaseAdminClient {
|
|
|
881
924
|
* for more details and examples.
|
|
882
925
|
*/
|
|
883
926
|
listBackupsStream(request, options) {
|
|
927
|
+
var _a;
|
|
884
928
|
request = request || {};
|
|
885
929
|
options = options || {};
|
|
886
930
|
options.otherArgs = options.otherArgs || {};
|
|
887
931
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
888
932
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
889
|
-
|
|
890
|
-
parent: request.parent
|
|
933
|
+
this._gaxModule.routingHeader.fromParams({
|
|
934
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
891
935
|
});
|
|
892
936
|
const defaultCallSettings = this._defaults['listBackups'];
|
|
893
937
|
const callSettings = defaultCallSettings.merge(options);
|
|
@@ -961,13 +1005,14 @@ class DatabaseAdminClient {
|
|
|
961
1005
|
* region_tag:spanner_v1_generated_DatabaseAdmin_ListBackups_async
|
|
962
1006
|
*/
|
|
963
1007
|
listBackupsAsync(request, options) {
|
|
1008
|
+
var _a;
|
|
964
1009
|
request = request || {};
|
|
965
1010
|
options = options || {};
|
|
966
1011
|
options.otherArgs = options.otherArgs || {};
|
|
967
1012
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
968
1013
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
969
|
-
|
|
970
|
-
parent: request.parent
|
|
1014
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1015
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
971
1016
|
});
|
|
972
1017
|
const defaultCallSettings = this._defaults['listBackups'];
|
|
973
1018
|
const callSettings = defaultCallSettings.merge(options);
|
|
@@ -975,6 +1020,7 @@ class DatabaseAdminClient {
|
|
|
975
1020
|
return this.descriptors.page.listBackups.asyncIterate(this.innerApiCalls['listBackups'], request, callSettings);
|
|
976
1021
|
}
|
|
977
1022
|
listDatabaseOperations(request, optionsOrCallback, callback) {
|
|
1023
|
+
var _a;
|
|
978
1024
|
request = request || {};
|
|
979
1025
|
let options;
|
|
980
1026
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -988,8 +1034,8 @@ class DatabaseAdminClient {
|
|
|
988
1034
|
options.otherArgs = options.otherArgs || {};
|
|
989
1035
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
990
1036
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
991
|
-
|
|
992
|
-
parent: request.parent
|
|
1037
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1038
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
993
1039
|
});
|
|
994
1040
|
this.initialize();
|
|
995
1041
|
return this.innerApiCalls.listDatabaseOperations(request, options, callback);
|
|
@@ -1065,13 +1111,14 @@ class DatabaseAdminClient {
|
|
|
1065
1111
|
* for more details and examples.
|
|
1066
1112
|
*/
|
|
1067
1113
|
listDatabaseOperationsStream(request, options) {
|
|
1114
|
+
var _a;
|
|
1068
1115
|
request = request || {};
|
|
1069
1116
|
options = options || {};
|
|
1070
1117
|
options.otherArgs = options.otherArgs || {};
|
|
1071
1118
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1072
1119
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1073
|
-
|
|
1074
|
-
parent: request.parent
|
|
1120
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1121
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
1075
1122
|
});
|
|
1076
1123
|
const defaultCallSettings = this._defaults['listDatabaseOperations'];
|
|
1077
1124
|
const callSettings = defaultCallSettings.merge(options);
|
|
@@ -1152,13 +1199,14 @@ class DatabaseAdminClient {
|
|
|
1152
1199
|
* region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_async
|
|
1153
1200
|
*/
|
|
1154
1201
|
listDatabaseOperationsAsync(request, options) {
|
|
1202
|
+
var _a;
|
|
1155
1203
|
request = request || {};
|
|
1156
1204
|
options = options || {};
|
|
1157
1205
|
options.otherArgs = options.otherArgs || {};
|
|
1158
1206
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1159
1207
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1160
|
-
|
|
1161
|
-
parent: request.parent
|
|
1208
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1209
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
1162
1210
|
});
|
|
1163
1211
|
const defaultCallSettings = this._defaults['listDatabaseOperations'];
|
|
1164
1212
|
const callSettings = defaultCallSettings.merge(options);
|
|
@@ -1166,6 +1214,7 @@ class DatabaseAdminClient {
|
|
|
1166
1214
|
return this.descriptors.page.listDatabaseOperations.asyncIterate(this.innerApiCalls['listDatabaseOperations'], request, callSettings);
|
|
1167
1215
|
}
|
|
1168
1216
|
listBackupOperations(request, optionsOrCallback, callback) {
|
|
1217
|
+
var _a;
|
|
1169
1218
|
request = request || {};
|
|
1170
1219
|
let options;
|
|
1171
1220
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -1179,8 +1228,8 @@ class DatabaseAdminClient {
|
|
|
1179
1228
|
options.otherArgs = options.otherArgs || {};
|
|
1180
1229
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1181
1230
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1182
|
-
|
|
1183
|
-
parent: request.parent
|
|
1231
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1232
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
1184
1233
|
});
|
|
1185
1234
|
this.initialize();
|
|
1186
1235
|
return this.innerApiCalls.listBackupOperations(request, options, callback);
|
|
@@ -1280,13 +1329,14 @@ class DatabaseAdminClient {
|
|
|
1280
1329
|
* for more details and examples.
|
|
1281
1330
|
*/
|
|
1282
1331
|
listBackupOperationsStream(request, options) {
|
|
1332
|
+
var _a;
|
|
1283
1333
|
request = request || {};
|
|
1284
1334
|
options = options || {};
|
|
1285
1335
|
options.otherArgs = options.otherArgs || {};
|
|
1286
1336
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1287
1337
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1288
|
-
|
|
1289
|
-
parent: request.parent
|
|
1338
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1339
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
1290
1340
|
});
|
|
1291
1341
|
const defaultCallSettings = this._defaults['listBackupOperations'];
|
|
1292
1342
|
const callSettings = defaultCallSettings.merge(options);
|
|
@@ -1391,19 +1441,258 @@ class DatabaseAdminClient {
|
|
|
1391
1441
|
* region_tag:spanner_v1_generated_DatabaseAdmin_ListBackupOperations_async
|
|
1392
1442
|
*/
|
|
1393
1443
|
listBackupOperationsAsync(request, options) {
|
|
1444
|
+
var _a;
|
|
1394
1445
|
request = request || {};
|
|
1395
1446
|
options = options || {};
|
|
1396
1447
|
options.otherArgs = options.otherArgs || {};
|
|
1397
1448
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1398
1449
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1399
|
-
|
|
1400
|
-
parent: request.parent
|
|
1450
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1451
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
1401
1452
|
});
|
|
1402
1453
|
const defaultCallSettings = this._defaults['listBackupOperations'];
|
|
1403
1454
|
const callSettings = defaultCallSettings.merge(options);
|
|
1404
1455
|
this.initialize();
|
|
1405
1456
|
return this.descriptors.page.listBackupOperations.asyncIterate(this.innerApiCalls['listBackupOperations'], request, callSettings);
|
|
1406
1457
|
}
|
|
1458
|
+
listDatabaseRoles(request, optionsOrCallback, callback) {
|
|
1459
|
+
var _a;
|
|
1460
|
+
request = request || {};
|
|
1461
|
+
let options;
|
|
1462
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1463
|
+
callback = optionsOrCallback;
|
|
1464
|
+
options = {};
|
|
1465
|
+
}
|
|
1466
|
+
else {
|
|
1467
|
+
options = optionsOrCallback;
|
|
1468
|
+
}
|
|
1469
|
+
options = options || {};
|
|
1470
|
+
options.otherArgs = options.otherArgs || {};
|
|
1471
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1472
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
1473
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1474
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
1475
|
+
});
|
|
1476
|
+
this.initialize();
|
|
1477
|
+
return this.innerApiCalls.listDatabaseRoles(request, options, callback);
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
|
|
1481
|
+
* @param {Object} request
|
|
1482
|
+
* The request object that will be sent.
|
|
1483
|
+
* @param {string} request.parent
|
|
1484
|
+
* Required. The database whose roles should be listed.
|
|
1485
|
+
* Values are of the form
|
|
1486
|
+
* `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
|
|
1487
|
+
* @param {number} request.pageSize
|
|
1488
|
+
* Number of database roles to be returned in the response. If 0 or less,
|
|
1489
|
+
* defaults to the server's maximum allowed page size.
|
|
1490
|
+
* @param {string} request.pageToken
|
|
1491
|
+
* If non-empty, `page_token` should contain a
|
|
1492
|
+
* {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} from a
|
|
1493
|
+
* previous {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}.
|
|
1494
|
+
* @param {object} [options]
|
|
1495
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1496
|
+
* @returns {Stream}
|
|
1497
|
+
* An object stream which emits an object representing [DatabaseRole]{@link google.spanner.admin.database.v1.DatabaseRole} on 'data' event.
|
|
1498
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
1499
|
+
* times as needed. Note that it can affect your quota.
|
|
1500
|
+
* We recommend using `listDatabaseRolesAsync()`
|
|
1501
|
+
* method described below for async iteration which you can stop as needed.
|
|
1502
|
+
* Please see the
|
|
1503
|
+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1504
|
+
* for more details and examples.
|
|
1505
|
+
*/
|
|
1506
|
+
listDatabaseRolesStream(request, options) {
|
|
1507
|
+
var _a;
|
|
1508
|
+
request = request || {};
|
|
1509
|
+
options = options || {};
|
|
1510
|
+
options.otherArgs = options.otherArgs || {};
|
|
1511
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1512
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
1513
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1514
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
1515
|
+
});
|
|
1516
|
+
const defaultCallSettings = this._defaults['listDatabaseRoles'];
|
|
1517
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1518
|
+
this.initialize();
|
|
1519
|
+
return this.descriptors.page.listDatabaseRoles.createStream(this.innerApiCalls.listDatabaseRoles, request, callSettings);
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* Equivalent to `listDatabaseRoles`, but returns an iterable object.
|
|
1523
|
+
*
|
|
1524
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
|
1525
|
+
* @param {Object} request
|
|
1526
|
+
* The request object that will be sent.
|
|
1527
|
+
* @param {string} request.parent
|
|
1528
|
+
* Required. The database whose roles should be listed.
|
|
1529
|
+
* Values are of the form
|
|
1530
|
+
* `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
|
|
1531
|
+
* @param {number} request.pageSize
|
|
1532
|
+
* Number of database roles to be returned in the response. If 0 or less,
|
|
1533
|
+
* defaults to the server's maximum allowed page size.
|
|
1534
|
+
* @param {string} request.pageToken
|
|
1535
|
+
* If non-empty, `page_token` should contain a
|
|
1536
|
+
* {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse.next_page_token|next_page_token} from a
|
|
1537
|
+
* previous {@link google.spanner.admin.database.v1.ListDatabaseRolesResponse|ListDatabaseRolesResponse}.
|
|
1538
|
+
* @param {object} [options]
|
|
1539
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1540
|
+
* @returns {Object}
|
|
1541
|
+
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
|
|
1542
|
+
* When you iterate the returned iterable, each element will be an object representing
|
|
1543
|
+
* [DatabaseRole]{@link google.spanner.admin.database.v1.DatabaseRole}. The API will be called under the hood as needed, once per the page,
|
|
1544
|
+
* so you can stop the iteration when you don't need more results.
|
|
1545
|
+
* Please see the
|
|
1546
|
+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1547
|
+
* for more details and examples.
|
|
1548
|
+
* @example <caption>include:samples/generated/v1/database_admin.list_database_roles.js</caption>
|
|
1549
|
+
* region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabaseRoles_async
|
|
1550
|
+
*/
|
|
1551
|
+
listDatabaseRolesAsync(request, options) {
|
|
1552
|
+
var _a;
|
|
1553
|
+
request = request || {};
|
|
1554
|
+
options = options || {};
|
|
1555
|
+
options.otherArgs = options.otherArgs || {};
|
|
1556
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1557
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
1558
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1559
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
1560
|
+
});
|
|
1561
|
+
const defaultCallSettings = this._defaults['listDatabaseRoles'];
|
|
1562
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1563
|
+
this.initialize();
|
|
1564
|
+
return this.descriptors.page.listDatabaseRoles.asyncIterate(this.innerApiCalls['listDatabaseRoles'], request, callSettings);
|
|
1565
|
+
}
|
|
1566
|
+
/**
|
|
1567
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
|
1568
|
+
* method to poll the operation result at intervals as recommended by the API
|
|
1569
|
+
* service.
|
|
1570
|
+
*
|
|
1571
|
+
* @param {Object} request - The request object that will be sent.
|
|
1572
|
+
* @param {string} request.name - The name of the operation resource.
|
|
1573
|
+
* @param {Object=} options
|
|
1574
|
+
* Optional parameters. You can override the default settings for this call,
|
|
1575
|
+
* e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
|
|
1576
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
|
|
1577
|
+
* details.
|
|
1578
|
+
* @param {function(?Error, ?Object)=} callback
|
|
1579
|
+
* The function which will be called with the result of the API call.
|
|
1580
|
+
*
|
|
1581
|
+
* The second parameter to the callback is an object representing
|
|
1582
|
+
* [google.longrunning.Operation]{@link
|
|
1583
|
+
* external:"google.longrunning.Operation"}.
|
|
1584
|
+
* @return {Promise} - The promise which resolves to an array.
|
|
1585
|
+
* The first element of the array is an object representing
|
|
1586
|
+
* [google.longrunning.Operation]{@link
|
|
1587
|
+
* external:"google.longrunning.Operation"}. The promise has a method named
|
|
1588
|
+
* "cancel" which cancels the ongoing API call.
|
|
1589
|
+
*
|
|
1590
|
+
* @example
|
|
1591
|
+
* ```
|
|
1592
|
+
* const client = longrunning.operationsClient();
|
|
1593
|
+
* const name = '';
|
|
1594
|
+
* const [response] = await client.getOperation({name});
|
|
1595
|
+
* // doThingsWith(response)
|
|
1596
|
+
* ```
|
|
1597
|
+
*/
|
|
1598
|
+
getOperation(request, options, callback) {
|
|
1599
|
+
return this.operationsClient.getOperation(request, options, callback);
|
|
1600
|
+
}
|
|
1601
|
+
/**
|
|
1602
|
+
* Lists operations that match the specified filter in the request. If the
|
|
1603
|
+
* server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
|
|
1604
|
+
*
|
|
1605
|
+
* For-await-of syntax is used with the iterable to recursively get response element on-demand.
|
|
1606
|
+
*
|
|
1607
|
+
* @param {Object} request - The request object that will be sent.
|
|
1608
|
+
* @param {string} request.name - The name of the operation collection.
|
|
1609
|
+
* @param {string} request.filter - The standard list filter.
|
|
1610
|
+
* @param {number=} request.pageSize -
|
|
1611
|
+
* The maximum number of resources contained in the underlying API
|
|
1612
|
+
* response. If page streaming is performed per-resource, this
|
|
1613
|
+
* parameter does not affect the return value. If page streaming is
|
|
1614
|
+
* performed per-page, this determines the maximum number of
|
|
1615
|
+
* resources in a page.
|
|
1616
|
+
* @param {Object=} options
|
|
1617
|
+
* Optional parameters. You can override the default settings for this call,
|
|
1618
|
+
* e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
|
|
1619
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
|
|
1620
|
+
* details.
|
|
1621
|
+
* @returns {Object}
|
|
1622
|
+
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
|
|
1623
|
+
*
|
|
1624
|
+
* @example
|
|
1625
|
+
* ```
|
|
1626
|
+
* const client = longrunning.operationsClient();
|
|
1627
|
+
* for await (const response of client.listOperationsAsync(request));
|
|
1628
|
+
* // doThingsWith(response)
|
|
1629
|
+
* ```
|
|
1630
|
+
*/
|
|
1631
|
+
listOperationsAsync(request, options) {
|
|
1632
|
+
return this.operationsClient.listOperationsAsync(request, options);
|
|
1633
|
+
}
|
|
1634
|
+
/**
|
|
1635
|
+
* Starts asynchronous cancellation on a long-running operation. The server
|
|
1636
|
+
* makes a best effort to cancel the operation, but success is not
|
|
1637
|
+
* guaranteed. If the server doesn't support this method, it returns
|
|
1638
|
+
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use
|
|
1639
|
+
* {@link Operations.GetOperation} or
|
|
1640
|
+
* other methods to check whether the cancellation succeeded or whether the
|
|
1641
|
+
* operation completed despite cancellation. On successful cancellation,
|
|
1642
|
+
* the operation is not deleted; instead, it becomes an operation with
|
|
1643
|
+
* an {@link Operation.error} value with a {@link google.rpc.Status.code} of
|
|
1644
|
+
* 1, corresponding to `Code.CANCELLED`.
|
|
1645
|
+
*
|
|
1646
|
+
* @param {Object} request - The request object that will be sent.
|
|
1647
|
+
* @param {string} request.name - The name of the operation resource to be cancelled.
|
|
1648
|
+
* @param {Object=} options
|
|
1649
|
+
* Optional parameters. You can override the default settings for this call,
|
|
1650
|
+
* e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
|
|
1651
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
|
|
1652
|
+
* details.
|
|
1653
|
+
* @param {function(?Error)=} callback
|
|
1654
|
+
* The function which will be called with the result of the API call.
|
|
1655
|
+
* @return {Promise} - The promise which resolves when API call finishes.
|
|
1656
|
+
* The promise has a method named "cancel" which cancels the ongoing API
|
|
1657
|
+
* call.
|
|
1658
|
+
*
|
|
1659
|
+
* @example
|
|
1660
|
+
* ```
|
|
1661
|
+
* const client = longrunning.operationsClient();
|
|
1662
|
+
* await client.cancelOperation({name: ''});
|
|
1663
|
+
* ```
|
|
1664
|
+
*/
|
|
1665
|
+
cancelOperation(request, options, callback) {
|
|
1666
|
+
return this.operationsClient.cancelOperation(request, options, callback);
|
|
1667
|
+
}
|
|
1668
|
+
/**
|
|
1669
|
+
* Deletes a long-running operation. This method indicates that the client is
|
|
1670
|
+
* no longer interested in the operation result. It does not cancel the
|
|
1671
|
+
* operation. If the server doesn't support this method, it returns
|
|
1672
|
+
* `google.rpc.Code.UNIMPLEMENTED`.
|
|
1673
|
+
*
|
|
1674
|
+
* @param {Object} request - The request object that will be sent.
|
|
1675
|
+
* @param {string} request.name - The name of the operation resource to be deleted.
|
|
1676
|
+
* @param {Object=} options
|
|
1677
|
+
* Optional parameters. You can override the default settings for this call,
|
|
1678
|
+
* e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
|
|
1679
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
|
|
1680
|
+
* details.
|
|
1681
|
+
* @param {function(?Error)=} callback
|
|
1682
|
+
* The function which will be called with the result of the API call.
|
|
1683
|
+
* @return {Promise} - The promise which resolves when API call finishes.
|
|
1684
|
+
* The promise has a method named "cancel" which cancels the ongoing API
|
|
1685
|
+
* call.
|
|
1686
|
+
*
|
|
1687
|
+
* @example
|
|
1688
|
+
* ```
|
|
1689
|
+
* const client = longrunning.operationsClient();
|
|
1690
|
+
* await client.deleteOperation({name: ''});
|
|
1691
|
+
* ```
|
|
1692
|
+
*/
|
|
1693
|
+
deleteOperation(request, options, callback) {
|
|
1694
|
+
return this.operationsClient.deleteOperation(request, options, callback);
|
|
1695
|
+
}
|
|
1407
1696
|
// --------------------
|
|
1408
1697
|
// -- Path templates --
|
|
1409
1698
|
// --------------------
|
|
@@ -1558,6 +1847,67 @@ class DatabaseAdminClient {
|
|
|
1558
1847
|
matchDatabaseFromDatabaseName(databaseName) {
|
|
1559
1848
|
return this.pathTemplates.databasePathTemplate.match(databaseName).database;
|
|
1560
1849
|
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Return a fully-qualified databaseRole resource name string.
|
|
1852
|
+
*
|
|
1853
|
+
* @param {string} project
|
|
1854
|
+
* @param {string} instance
|
|
1855
|
+
* @param {string} database
|
|
1856
|
+
* @param {string} role
|
|
1857
|
+
* @returns {string} Resource name string.
|
|
1858
|
+
*/
|
|
1859
|
+
databaseRolePath(project, instance, database, role) {
|
|
1860
|
+
return this.pathTemplates.databaseRolePathTemplate.render({
|
|
1861
|
+
project: project,
|
|
1862
|
+
instance: instance,
|
|
1863
|
+
database: database,
|
|
1864
|
+
role: role,
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
/**
|
|
1868
|
+
* Parse the project from DatabaseRole resource.
|
|
1869
|
+
*
|
|
1870
|
+
* @param {string} databaseRoleName
|
|
1871
|
+
* A fully-qualified path representing DatabaseRole resource.
|
|
1872
|
+
* @returns {string} A string representing the project.
|
|
1873
|
+
*/
|
|
1874
|
+
matchProjectFromDatabaseRoleName(databaseRoleName) {
|
|
1875
|
+
return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
|
|
1876
|
+
.project;
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* Parse the instance from DatabaseRole resource.
|
|
1880
|
+
*
|
|
1881
|
+
* @param {string} databaseRoleName
|
|
1882
|
+
* A fully-qualified path representing DatabaseRole resource.
|
|
1883
|
+
* @returns {string} A string representing the instance.
|
|
1884
|
+
*/
|
|
1885
|
+
matchInstanceFromDatabaseRoleName(databaseRoleName) {
|
|
1886
|
+
return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
|
|
1887
|
+
.instance;
|
|
1888
|
+
}
|
|
1889
|
+
/**
|
|
1890
|
+
* Parse the database from DatabaseRole resource.
|
|
1891
|
+
*
|
|
1892
|
+
* @param {string} databaseRoleName
|
|
1893
|
+
* A fully-qualified path representing DatabaseRole resource.
|
|
1894
|
+
* @returns {string} A string representing the database.
|
|
1895
|
+
*/
|
|
1896
|
+
matchDatabaseFromDatabaseRoleName(databaseRoleName) {
|
|
1897
|
+
return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
|
|
1898
|
+
.database;
|
|
1899
|
+
}
|
|
1900
|
+
/**
|
|
1901
|
+
* Parse the role from DatabaseRole resource.
|
|
1902
|
+
*
|
|
1903
|
+
* @param {string} databaseRoleName
|
|
1904
|
+
* A fully-qualified path representing DatabaseRole resource.
|
|
1905
|
+
* @returns {string} A string representing the role.
|
|
1906
|
+
*/
|
|
1907
|
+
matchRoleFromDatabaseRoleName(databaseRoleName) {
|
|
1908
|
+
return this.pathTemplates.databaseRolePathTemplate.match(databaseRoleName)
|
|
1909
|
+
.role;
|
|
1910
|
+
}
|
|
1561
1911
|
/**
|
|
1562
1912
|
* Return a fully-qualified instance resource name string.
|
|
1563
1913
|
*
|