@google-cloud/spanner 7.21.0 → 8.1.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/README.md +2 -0
- package/build/protos/google/spanner/admin/database/v1/backup.proto +1 -1
- package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +1 -1
- package/build/protos/google/spanner/admin/database/v1/common.proto +1 -1
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +36 -1
- package/build/protos/google/spanner/admin/instance/v1/common.proto +1 -1
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +1 -1
- package/build/protos/google/spanner/executor/v1/cloud_executor.proto +1 -1
- package/build/protos/google/spanner/v1/change_stream.proto +451 -0
- package/build/protos/google/spanner/v1/commit_response.proto +10 -5
- package/build/protos/google/spanner/v1/keys.proto +1 -1
- package/build/protos/google/spanner/v1/mutation.proto +1 -1
- package/build/protos/google/spanner/v1/query_plan.proto +1 -1
- package/build/protos/google/spanner/v1/result_set.proto +55 -49
- package/build/protos/google/spanner/v1/spanner.proto +1 -1
- package/build/protos/google/spanner/v1/transaction.proto +41 -357
- package/build/protos/google/spanner/v1/type.proto +1 -1
- package/build/protos/protos.d.ts +1577 -194
- package/build/protos/protos.js +3977 -288
- package/build/protos/protos.json +325 -3
- package/build/src/backup.js +7 -0
- package/build/src/batch-transaction.d.ts +48 -29
- package/build/src/batch-transaction.js +15 -100
- package/build/src/codec.js +63 -47
- package/build/src/common-grpc/service-object.js +1 -0
- package/build/src/common-grpc/service.js +35 -18
- package/build/src/common.d.ts +1 -0
- package/build/src/common.js +9 -1
- package/build/src/database.d.ts +1 -0
- package/build/src/database.js +54 -42
- package/build/src/helper.d.ts +99 -0
- package/build/src/helper.js +178 -0
- package/build/src/index.d.ts +33 -0
- package/build/src/index.js +202 -21
- package/build/src/instance-config.d.ts +1 -1
- package/build/src/instance-config.js +4 -0
- package/build/src/instance.js +12 -6
- package/build/src/instrument.js +5 -6
- package/build/src/metrics/constants.d.ts +36 -0
- package/build/src/metrics/constants.js +106 -0
- package/build/src/metrics/external-types.d.ts +20 -0
- package/build/src/metrics/external-types.js +32 -0
- package/build/src/metrics/interceptor.d.ts +13 -0
- package/build/src/metrics/interceptor.js +87 -0
- package/build/src/metrics/metrics-tracer-factory.d.ts +165 -0
- package/build/src/metrics/metrics-tracer-factory.js +389 -0
- package/build/src/metrics/metrics-tracer.d.ts +204 -0
- package/build/src/metrics/metrics-tracer.js +371 -0
- package/build/src/metrics/spanner-metrics-exporter.d.ts +35 -0
- package/build/src/metrics/spanner-metrics-exporter.js +119 -0
- package/build/src/metrics/transform.d.ts +144 -0
- package/build/src/metrics/transform.js +272 -0
- package/build/src/multiplexed-session.js +7 -1
- package/build/src/partial-result-stream.js +18 -10
- package/build/src/request_id_header.js +1 -0
- package/build/src/session-factory.d.ts +34 -0
- package/build/src/session-factory.js +35 -2
- package/build/src/session-pool.js +24 -8
- package/build/src/session.d.ts +0 -1
- package/build/src/session.js +7 -2
- package/build/src/table.js +6 -3
- package/build/src/transaction-runner.d.ts +1 -0
- package/build/src/transaction-runner.js +18 -2
- package/build/src/transaction.d.ts +42 -1
- package/build/src/transaction.js +258 -94
- package/build/src/v1/database_admin_client.d.ts +37 -2
- package/build/src/v1/database_admin_client.js +718 -168
- package/build/src/v1/database_admin_client_config.json +4 -0
- package/build/src/v1/instance_admin_client.d.ts +122 -1
- package/build/src/v1/instance_admin_client.js +765 -146
- package/build/src/v1/spanner_client.d.ts +2 -1
- package/build/src/v1/spanner_client.js +391 -85
- package/build/src/v1/spanner_executor_proxy_client.d.ts +2 -1
- package/build/src/v1/spanner_executor_proxy_client.js +41 -19
- package/build/src/v1/spanner_proto_list.json +1 -0
- package/package.json +64 -58
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.DatabaseAdminClient = void 0;
|
|
21
21
|
const jsonProtos = require("../../protos/protos.json");
|
|
22
|
+
const google_gax_1 = require("google-gax");
|
|
22
23
|
/**
|
|
23
24
|
* Client JSON configuration object, loaded from
|
|
24
25
|
* `src/v1/database_admin_client_config.json`.
|
|
@@ -38,6 +39,28 @@ const version = require('../../../package.json').version;
|
|
|
38
39
|
* @memberof v1
|
|
39
40
|
*/
|
|
40
41
|
class DatabaseAdminClient {
|
|
42
|
+
_terminated = false;
|
|
43
|
+
_opts;
|
|
44
|
+
_providedCustomServicePath;
|
|
45
|
+
_gaxModule;
|
|
46
|
+
_gaxGrpc;
|
|
47
|
+
_protos;
|
|
48
|
+
_defaults;
|
|
49
|
+
_universeDomain;
|
|
50
|
+
_servicePath;
|
|
51
|
+
_log = google_gax_1.loggingUtils.log('spanner');
|
|
52
|
+
auth;
|
|
53
|
+
descriptors = {
|
|
54
|
+
page: {},
|
|
55
|
+
stream: {},
|
|
56
|
+
longrunning: {},
|
|
57
|
+
batching: {},
|
|
58
|
+
};
|
|
59
|
+
warn;
|
|
60
|
+
innerApiCalls;
|
|
61
|
+
pathTemplates;
|
|
62
|
+
operationsClient;
|
|
63
|
+
databaseAdminStub;
|
|
41
64
|
/**
|
|
42
65
|
* Construct an instance of DatabaseAdminClient.
|
|
43
66
|
*
|
|
@@ -60,7 +83,7 @@ class DatabaseAdminClient {
|
|
|
60
83
|
* Developer's Console, e.g. 'grape-spaceship-123'. We will also check
|
|
61
84
|
* the environment variable GCLOUD_PROJECT for your project ID. If your
|
|
62
85
|
* app is running in an environment which supports
|
|
63
|
-
* {@link https://
|
|
86
|
+
* {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
|
|
64
87
|
* your project ID will be detected automatically.
|
|
65
88
|
* @param {string} [options.apiEndpoint] - The domain name of the
|
|
66
89
|
* API remote host.
|
|
@@ -78,32 +101,28 @@ class DatabaseAdminClient {
|
|
|
78
101
|
* ```
|
|
79
102
|
*/
|
|
80
103
|
constructor(opts, gaxInstance) {
|
|
81
|
-
var _a, _b, _c, _d, _e;
|
|
82
|
-
this._terminated = false;
|
|
83
|
-
this.descriptors = {
|
|
84
|
-
page: {},
|
|
85
|
-
stream: {},
|
|
86
|
-
longrunning: {},
|
|
87
|
-
batching: {},
|
|
88
|
-
};
|
|
89
104
|
// Ensure that options include all the required fields.
|
|
90
105
|
const staticMembers = this.constructor;
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
106
|
+
if (opts?.universe_domain &&
|
|
107
|
+
opts?.universeDomain &&
|
|
108
|
+
opts?.universe_domain !== opts?.universeDomain) {
|
|
94
109
|
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
95
110
|
}
|
|
96
111
|
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
|
97
112
|
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
|
|
98
113
|
: undefined;
|
|
99
114
|
this._universeDomain =
|
|
100
|
-
|
|
115
|
+
opts?.universeDomain ??
|
|
116
|
+
opts?.universe_domain ??
|
|
117
|
+
universeDomainEnvVar ??
|
|
118
|
+
'googleapis.com';
|
|
101
119
|
this._servicePath = 'spanner.' + this._universeDomain;
|
|
102
|
-
const servicePath =
|
|
103
|
-
this._providedCustomServicePath = !!(
|
|
104
|
-
const port =
|
|
105
|
-
const clientConfig =
|
|
106
|
-
const fallback =
|
|
120
|
+
const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
|
|
121
|
+
this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
|
|
122
|
+
const port = opts?.port || staticMembers.port;
|
|
123
|
+
const clientConfig = opts?.clientConfig ?? {};
|
|
124
|
+
const fallback = opts?.fallback ??
|
|
125
|
+
(typeof window !== 'undefined' && typeof window?.fetch === 'function');
|
|
107
126
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
108
127
|
// Request numeric enum values if REST transport is used.
|
|
109
128
|
opts.numericEnums = true;
|
|
@@ -172,7 +191,7 @@ class DatabaseAdminClient {
|
|
|
172
191
|
listDatabaseRoles: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databaseRoles'),
|
|
173
192
|
listBackupSchedules: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupSchedules'),
|
|
174
193
|
};
|
|
175
|
-
const protoFilesRoot = this._gaxModule.
|
|
194
|
+
const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
|
|
176
195
|
// This API contains "long-running operations", which return a
|
|
177
196
|
// an Operation object that allows for tracking of the operation,
|
|
178
197
|
// rather than holding a request open.
|
|
@@ -310,6 +329,7 @@ class DatabaseAdminClient {
|
|
|
310
329
|
'updateBackupSchedule',
|
|
311
330
|
'deleteBackupSchedule',
|
|
312
331
|
'listBackupSchedules',
|
|
332
|
+
'internalUpdateGraphOperation',
|
|
313
333
|
];
|
|
314
334
|
for (const methodName of databaseAdminStubMethods) {
|
|
315
335
|
const callPromise = this.databaseAdminStub.then(stub => (...args) => {
|
|
@@ -393,7 +413,6 @@ class DatabaseAdminClient {
|
|
|
393
413
|
return this.auth.getProjectId();
|
|
394
414
|
}
|
|
395
415
|
getDatabase(request, optionsOrCallback, callback) {
|
|
396
|
-
var _a;
|
|
397
416
|
request = request || {};
|
|
398
417
|
let options;
|
|
399
418
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -408,13 +427,35 @@ class DatabaseAdminClient {
|
|
|
408
427
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
409
428
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
410
429
|
this._gaxModule.routingHeader.fromParams({
|
|
411
|
-
name:
|
|
430
|
+
name: request.name ?? '',
|
|
412
431
|
});
|
|
413
|
-
this.initialize()
|
|
414
|
-
|
|
432
|
+
this.initialize().catch(err => {
|
|
433
|
+
throw err;
|
|
434
|
+
});
|
|
435
|
+
this._log.info('getDatabase request %j', request);
|
|
436
|
+
const wrappedCallback = callback
|
|
437
|
+
? (error, response, options, rawResponse) => {
|
|
438
|
+
this._log.info('getDatabase response %j', response);
|
|
439
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
440
|
+
}
|
|
441
|
+
: undefined;
|
|
442
|
+
return this.innerApiCalls
|
|
443
|
+
.getDatabase(request, options, wrappedCallback)
|
|
444
|
+
?.then(([response, options, rawResponse]) => {
|
|
445
|
+
this._log.info('getDatabase response %j', response);
|
|
446
|
+
return [response, options, rawResponse];
|
|
447
|
+
})
|
|
448
|
+
.catch((error) => {
|
|
449
|
+
if (error &&
|
|
450
|
+
'statusDetails' in error &&
|
|
451
|
+
error.statusDetails instanceof Array) {
|
|
452
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
453
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
454
|
+
}
|
|
455
|
+
throw error;
|
|
456
|
+
});
|
|
415
457
|
}
|
|
416
458
|
dropDatabase(request, optionsOrCallback, callback) {
|
|
417
|
-
var _a;
|
|
418
459
|
request = request || {};
|
|
419
460
|
let options;
|
|
420
461
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -429,13 +470,35 @@ class DatabaseAdminClient {
|
|
|
429
470
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
430
471
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
431
472
|
this._gaxModule.routingHeader.fromParams({
|
|
432
|
-
database:
|
|
473
|
+
database: request.database ?? '',
|
|
433
474
|
});
|
|
434
|
-
this.initialize()
|
|
435
|
-
|
|
475
|
+
this.initialize().catch(err => {
|
|
476
|
+
throw err;
|
|
477
|
+
});
|
|
478
|
+
this._log.info('dropDatabase request %j', request);
|
|
479
|
+
const wrappedCallback = callback
|
|
480
|
+
? (error, response, options, rawResponse) => {
|
|
481
|
+
this._log.info('dropDatabase response %j', response);
|
|
482
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
483
|
+
}
|
|
484
|
+
: undefined;
|
|
485
|
+
return this.innerApiCalls
|
|
486
|
+
.dropDatabase(request, options, wrappedCallback)
|
|
487
|
+
?.then(([response, options, rawResponse]) => {
|
|
488
|
+
this._log.info('dropDatabase response %j', response);
|
|
489
|
+
return [response, options, rawResponse];
|
|
490
|
+
})
|
|
491
|
+
.catch((error) => {
|
|
492
|
+
if (error &&
|
|
493
|
+
'statusDetails' in error &&
|
|
494
|
+
error.statusDetails instanceof Array) {
|
|
495
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
496
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
497
|
+
}
|
|
498
|
+
throw error;
|
|
499
|
+
});
|
|
436
500
|
}
|
|
437
501
|
getDatabaseDdl(request, optionsOrCallback, callback) {
|
|
438
|
-
var _a;
|
|
439
502
|
request = request || {};
|
|
440
503
|
let options;
|
|
441
504
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -450,13 +513,35 @@ class DatabaseAdminClient {
|
|
|
450
513
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
451
514
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
452
515
|
this._gaxModule.routingHeader.fromParams({
|
|
453
|
-
database:
|
|
516
|
+
database: request.database ?? '',
|
|
454
517
|
});
|
|
455
|
-
this.initialize()
|
|
456
|
-
|
|
518
|
+
this.initialize().catch(err => {
|
|
519
|
+
throw err;
|
|
520
|
+
});
|
|
521
|
+
this._log.info('getDatabaseDdl request %j', request);
|
|
522
|
+
const wrappedCallback = callback
|
|
523
|
+
? (error, response, options, rawResponse) => {
|
|
524
|
+
this._log.info('getDatabaseDdl response %j', response);
|
|
525
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
526
|
+
}
|
|
527
|
+
: undefined;
|
|
528
|
+
return this.innerApiCalls
|
|
529
|
+
.getDatabaseDdl(request, options, wrappedCallback)
|
|
530
|
+
?.then(([response, options, rawResponse]) => {
|
|
531
|
+
this._log.info('getDatabaseDdl response %j', response);
|
|
532
|
+
return [response, options, rawResponse];
|
|
533
|
+
})
|
|
534
|
+
.catch((error) => {
|
|
535
|
+
if (error &&
|
|
536
|
+
'statusDetails' in error &&
|
|
537
|
+
error.statusDetails instanceof Array) {
|
|
538
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
539
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
540
|
+
}
|
|
541
|
+
throw error;
|
|
542
|
+
});
|
|
457
543
|
}
|
|
458
544
|
setIamPolicy(request, optionsOrCallback, callback) {
|
|
459
|
-
var _a;
|
|
460
545
|
request = request || {};
|
|
461
546
|
let options;
|
|
462
547
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -471,13 +556,35 @@ class DatabaseAdminClient {
|
|
|
471
556
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
472
557
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
473
558
|
this._gaxModule.routingHeader.fromParams({
|
|
474
|
-
resource:
|
|
559
|
+
resource: request.resource ?? '',
|
|
475
560
|
});
|
|
476
|
-
this.initialize()
|
|
477
|
-
|
|
561
|
+
this.initialize().catch(err => {
|
|
562
|
+
throw err;
|
|
563
|
+
});
|
|
564
|
+
this._log.info('setIamPolicy request %j', request);
|
|
565
|
+
const wrappedCallback = callback
|
|
566
|
+
? (error, response, options, rawResponse) => {
|
|
567
|
+
this._log.info('setIamPolicy response %j', response);
|
|
568
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
569
|
+
}
|
|
570
|
+
: undefined;
|
|
571
|
+
return this.innerApiCalls
|
|
572
|
+
.setIamPolicy(request, options, wrappedCallback)
|
|
573
|
+
?.then(([response, options, rawResponse]) => {
|
|
574
|
+
this._log.info('setIamPolicy response %j', response);
|
|
575
|
+
return [response, options, rawResponse];
|
|
576
|
+
})
|
|
577
|
+
.catch((error) => {
|
|
578
|
+
if (error &&
|
|
579
|
+
'statusDetails' in error &&
|
|
580
|
+
error.statusDetails instanceof Array) {
|
|
581
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
582
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
583
|
+
}
|
|
584
|
+
throw error;
|
|
585
|
+
});
|
|
478
586
|
}
|
|
479
587
|
getIamPolicy(request, optionsOrCallback, callback) {
|
|
480
|
-
var _a;
|
|
481
588
|
request = request || {};
|
|
482
589
|
let options;
|
|
483
590
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -492,13 +599,35 @@ class DatabaseAdminClient {
|
|
|
492
599
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
493
600
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
494
601
|
this._gaxModule.routingHeader.fromParams({
|
|
495
|
-
resource:
|
|
602
|
+
resource: request.resource ?? '',
|
|
496
603
|
});
|
|
497
|
-
this.initialize()
|
|
498
|
-
|
|
604
|
+
this.initialize().catch(err => {
|
|
605
|
+
throw err;
|
|
606
|
+
});
|
|
607
|
+
this._log.info('getIamPolicy request %j', request);
|
|
608
|
+
const wrappedCallback = callback
|
|
609
|
+
? (error, response, options, rawResponse) => {
|
|
610
|
+
this._log.info('getIamPolicy response %j', response);
|
|
611
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
612
|
+
}
|
|
613
|
+
: undefined;
|
|
614
|
+
return this.innerApiCalls
|
|
615
|
+
.getIamPolicy(request, options, wrappedCallback)
|
|
616
|
+
?.then(([response, options, rawResponse]) => {
|
|
617
|
+
this._log.info('getIamPolicy response %j', response);
|
|
618
|
+
return [response, options, rawResponse];
|
|
619
|
+
})
|
|
620
|
+
.catch((error) => {
|
|
621
|
+
if (error &&
|
|
622
|
+
'statusDetails' in error &&
|
|
623
|
+
error.statusDetails instanceof Array) {
|
|
624
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
625
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
626
|
+
}
|
|
627
|
+
throw error;
|
|
628
|
+
});
|
|
499
629
|
}
|
|
500
630
|
testIamPermissions(request, optionsOrCallback, callback) {
|
|
501
|
-
var _a;
|
|
502
631
|
request = request || {};
|
|
503
632
|
let options;
|
|
504
633
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -513,13 +642,35 @@ class DatabaseAdminClient {
|
|
|
513
642
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
514
643
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
515
644
|
this._gaxModule.routingHeader.fromParams({
|
|
516
|
-
resource:
|
|
645
|
+
resource: request.resource ?? '',
|
|
517
646
|
});
|
|
518
|
-
this.initialize()
|
|
519
|
-
|
|
647
|
+
this.initialize().catch(err => {
|
|
648
|
+
throw err;
|
|
649
|
+
});
|
|
650
|
+
this._log.info('testIamPermissions request %j', request);
|
|
651
|
+
const wrappedCallback = callback
|
|
652
|
+
? (error, response, options, rawResponse) => {
|
|
653
|
+
this._log.info('testIamPermissions response %j', response);
|
|
654
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
655
|
+
}
|
|
656
|
+
: undefined;
|
|
657
|
+
return this.innerApiCalls
|
|
658
|
+
.testIamPermissions(request, options, wrappedCallback)
|
|
659
|
+
?.then(([response, options, rawResponse]) => {
|
|
660
|
+
this._log.info('testIamPermissions response %j', response);
|
|
661
|
+
return [response, options, rawResponse];
|
|
662
|
+
})
|
|
663
|
+
.catch((error) => {
|
|
664
|
+
if (error &&
|
|
665
|
+
'statusDetails' in error &&
|
|
666
|
+
error.statusDetails instanceof Array) {
|
|
667
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
668
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
669
|
+
}
|
|
670
|
+
throw error;
|
|
671
|
+
});
|
|
520
672
|
}
|
|
521
673
|
getBackup(request, optionsOrCallback, callback) {
|
|
522
|
-
var _a;
|
|
523
674
|
request = request || {};
|
|
524
675
|
let options;
|
|
525
676
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -534,13 +685,35 @@ class DatabaseAdminClient {
|
|
|
534
685
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
535
686
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
536
687
|
this._gaxModule.routingHeader.fromParams({
|
|
537
|
-
name:
|
|
688
|
+
name: request.name ?? '',
|
|
538
689
|
});
|
|
539
|
-
this.initialize()
|
|
540
|
-
|
|
690
|
+
this.initialize().catch(err => {
|
|
691
|
+
throw err;
|
|
692
|
+
});
|
|
693
|
+
this._log.info('getBackup request %j', request);
|
|
694
|
+
const wrappedCallback = callback
|
|
695
|
+
? (error, response, options, rawResponse) => {
|
|
696
|
+
this._log.info('getBackup response %j', response);
|
|
697
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
698
|
+
}
|
|
699
|
+
: undefined;
|
|
700
|
+
return this.innerApiCalls
|
|
701
|
+
.getBackup(request, options, wrappedCallback)
|
|
702
|
+
?.then(([response, options, rawResponse]) => {
|
|
703
|
+
this._log.info('getBackup response %j', response);
|
|
704
|
+
return [response, options, rawResponse];
|
|
705
|
+
})
|
|
706
|
+
.catch((error) => {
|
|
707
|
+
if (error &&
|
|
708
|
+
'statusDetails' in error &&
|
|
709
|
+
error.statusDetails instanceof Array) {
|
|
710
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
711
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
712
|
+
}
|
|
713
|
+
throw error;
|
|
714
|
+
});
|
|
541
715
|
}
|
|
542
716
|
updateBackup(request, optionsOrCallback, callback) {
|
|
543
|
-
var _a;
|
|
544
717
|
request = request || {};
|
|
545
718
|
let options;
|
|
546
719
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -555,13 +728,35 @@ class DatabaseAdminClient {
|
|
|
555
728
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
556
729
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
557
730
|
this._gaxModule.routingHeader.fromParams({
|
|
558
|
-
'backup.name':
|
|
731
|
+
'backup.name': request.backup.name ?? '',
|
|
559
732
|
});
|
|
560
|
-
this.initialize()
|
|
561
|
-
|
|
733
|
+
this.initialize().catch(err => {
|
|
734
|
+
throw err;
|
|
735
|
+
});
|
|
736
|
+
this._log.info('updateBackup request %j', request);
|
|
737
|
+
const wrappedCallback = callback
|
|
738
|
+
? (error, response, options, rawResponse) => {
|
|
739
|
+
this._log.info('updateBackup response %j', response);
|
|
740
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
741
|
+
}
|
|
742
|
+
: undefined;
|
|
743
|
+
return this.innerApiCalls
|
|
744
|
+
.updateBackup(request, options, wrappedCallback)
|
|
745
|
+
?.then(([response, options, rawResponse]) => {
|
|
746
|
+
this._log.info('updateBackup response %j', response);
|
|
747
|
+
return [response, options, rawResponse];
|
|
748
|
+
})
|
|
749
|
+
.catch((error) => {
|
|
750
|
+
if (error &&
|
|
751
|
+
'statusDetails' in error &&
|
|
752
|
+
error.statusDetails instanceof Array) {
|
|
753
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
754
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
755
|
+
}
|
|
756
|
+
throw error;
|
|
757
|
+
});
|
|
562
758
|
}
|
|
563
759
|
deleteBackup(request, optionsOrCallback, callback) {
|
|
564
|
-
var _a;
|
|
565
760
|
request = request || {};
|
|
566
761
|
let options;
|
|
567
762
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -576,13 +771,35 @@ class DatabaseAdminClient {
|
|
|
576
771
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
577
772
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
578
773
|
this._gaxModule.routingHeader.fromParams({
|
|
579
|
-
name:
|
|
774
|
+
name: request.name ?? '',
|
|
580
775
|
});
|
|
581
|
-
this.initialize()
|
|
582
|
-
|
|
776
|
+
this.initialize().catch(err => {
|
|
777
|
+
throw err;
|
|
778
|
+
});
|
|
779
|
+
this._log.info('deleteBackup request %j', request);
|
|
780
|
+
const wrappedCallback = callback
|
|
781
|
+
? (error, response, options, rawResponse) => {
|
|
782
|
+
this._log.info('deleteBackup response %j', response);
|
|
783
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
784
|
+
}
|
|
785
|
+
: undefined;
|
|
786
|
+
return this.innerApiCalls
|
|
787
|
+
.deleteBackup(request, options, wrappedCallback)
|
|
788
|
+
?.then(([response, options, rawResponse]) => {
|
|
789
|
+
this._log.info('deleteBackup response %j', response);
|
|
790
|
+
return [response, options, rawResponse];
|
|
791
|
+
})
|
|
792
|
+
.catch((error) => {
|
|
793
|
+
if (error &&
|
|
794
|
+
'statusDetails' in error &&
|
|
795
|
+
error.statusDetails instanceof Array) {
|
|
796
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
797
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
798
|
+
}
|
|
799
|
+
throw error;
|
|
800
|
+
});
|
|
583
801
|
}
|
|
584
802
|
addSplitPoints(request, optionsOrCallback, callback) {
|
|
585
|
-
var _a;
|
|
586
803
|
request = request || {};
|
|
587
804
|
let options;
|
|
588
805
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -597,13 +814,35 @@ class DatabaseAdminClient {
|
|
|
597
814
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
598
815
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
599
816
|
this._gaxModule.routingHeader.fromParams({
|
|
600
|
-
database:
|
|
817
|
+
database: request.database ?? '',
|
|
601
818
|
});
|
|
602
|
-
this.initialize()
|
|
603
|
-
|
|
819
|
+
this.initialize().catch(err => {
|
|
820
|
+
throw err;
|
|
821
|
+
});
|
|
822
|
+
this._log.info('addSplitPoints request %j', request);
|
|
823
|
+
const wrappedCallback = callback
|
|
824
|
+
? (error, response, options, rawResponse) => {
|
|
825
|
+
this._log.info('addSplitPoints response %j', response);
|
|
826
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
827
|
+
}
|
|
828
|
+
: undefined;
|
|
829
|
+
return this.innerApiCalls
|
|
830
|
+
.addSplitPoints(request, options, wrappedCallback)
|
|
831
|
+
?.then(([response, options, rawResponse]) => {
|
|
832
|
+
this._log.info('addSplitPoints response %j', response);
|
|
833
|
+
return [response, options, rawResponse];
|
|
834
|
+
})
|
|
835
|
+
.catch((error) => {
|
|
836
|
+
if (error &&
|
|
837
|
+
'statusDetails' in error &&
|
|
838
|
+
error.statusDetails instanceof Array) {
|
|
839
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
840
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
841
|
+
}
|
|
842
|
+
throw error;
|
|
843
|
+
});
|
|
604
844
|
}
|
|
605
845
|
createBackupSchedule(request, optionsOrCallback, callback) {
|
|
606
|
-
var _a;
|
|
607
846
|
request = request || {};
|
|
608
847
|
let options;
|
|
609
848
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -618,13 +857,35 @@ class DatabaseAdminClient {
|
|
|
618
857
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
619
858
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
620
859
|
this._gaxModule.routingHeader.fromParams({
|
|
621
|
-
parent:
|
|
860
|
+
parent: request.parent ?? '',
|
|
622
861
|
});
|
|
623
|
-
this.initialize()
|
|
624
|
-
|
|
862
|
+
this.initialize().catch(err => {
|
|
863
|
+
throw err;
|
|
864
|
+
});
|
|
865
|
+
this._log.info('createBackupSchedule request %j', request);
|
|
866
|
+
const wrappedCallback = callback
|
|
867
|
+
? (error, response, options, rawResponse) => {
|
|
868
|
+
this._log.info('createBackupSchedule response %j', response);
|
|
869
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
870
|
+
}
|
|
871
|
+
: undefined;
|
|
872
|
+
return this.innerApiCalls
|
|
873
|
+
.createBackupSchedule(request, options, wrappedCallback)
|
|
874
|
+
?.then(([response, options, rawResponse]) => {
|
|
875
|
+
this._log.info('createBackupSchedule response %j', response);
|
|
876
|
+
return [response, options, rawResponse];
|
|
877
|
+
})
|
|
878
|
+
.catch((error) => {
|
|
879
|
+
if (error &&
|
|
880
|
+
'statusDetails' in error &&
|
|
881
|
+
error.statusDetails instanceof Array) {
|
|
882
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
883
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
884
|
+
}
|
|
885
|
+
throw error;
|
|
886
|
+
});
|
|
625
887
|
}
|
|
626
888
|
getBackupSchedule(request, optionsOrCallback, callback) {
|
|
627
|
-
var _a;
|
|
628
889
|
request = request || {};
|
|
629
890
|
let options;
|
|
630
891
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -639,13 +900,35 @@ class DatabaseAdminClient {
|
|
|
639
900
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
640
901
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
641
902
|
this._gaxModule.routingHeader.fromParams({
|
|
642
|
-
name:
|
|
903
|
+
name: request.name ?? '',
|
|
643
904
|
});
|
|
644
|
-
this.initialize()
|
|
645
|
-
|
|
905
|
+
this.initialize().catch(err => {
|
|
906
|
+
throw err;
|
|
907
|
+
});
|
|
908
|
+
this._log.info('getBackupSchedule request %j', request);
|
|
909
|
+
const wrappedCallback = callback
|
|
910
|
+
? (error, response, options, rawResponse) => {
|
|
911
|
+
this._log.info('getBackupSchedule response %j', response);
|
|
912
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
913
|
+
}
|
|
914
|
+
: undefined;
|
|
915
|
+
return this.innerApiCalls
|
|
916
|
+
.getBackupSchedule(request, options, wrappedCallback)
|
|
917
|
+
?.then(([response, options, rawResponse]) => {
|
|
918
|
+
this._log.info('getBackupSchedule response %j', response);
|
|
919
|
+
return [response, options, rawResponse];
|
|
920
|
+
})
|
|
921
|
+
.catch((error) => {
|
|
922
|
+
if (error &&
|
|
923
|
+
'statusDetails' in error &&
|
|
924
|
+
error.statusDetails instanceof Array) {
|
|
925
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
926
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
927
|
+
}
|
|
928
|
+
throw error;
|
|
929
|
+
});
|
|
646
930
|
}
|
|
647
931
|
updateBackupSchedule(request, optionsOrCallback, callback) {
|
|
648
|
-
var _a;
|
|
649
932
|
request = request || {};
|
|
650
933
|
let options;
|
|
651
934
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -660,13 +943,35 @@ class DatabaseAdminClient {
|
|
|
660
943
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
661
944
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
662
945
|
this._gaxModule.routingHeader.fromParams({
|
|
663
|
-
'backup_schedule.name':
|
|
946
|
+
'backup_schedule.name': request.backupSchedule.name ?? '',
|
|
664
947
|
});
|
|
665
|
-
this.initialize()
|
|
666
|
-
|
|
948
|
+
this.initialize().catch(err => {
|
|
949
|
+
throw err;
|
|
950
|
+
});
|
|
951
|
+
this._log.info('updateBackupSchedule request %j', request);
|
|
952
|
+
const wrappedCallback = callback
|
|
953
|
+
? (error, response, options, rawResponse) => {
|
|
954
|
+
this._log.info('updateBackupSchedule response %j', response);
|
|
955
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
956
|
+
}
|
|
957
|
+
: undefined;
|
|
958
|
+
return this.innerApiCalls
|
|
959
|
+
.updateBackupSchedule(request, options, wrappedCallback)
|
|
960
|
+
?.then(([response, options, rawResponse]) => {
|
|
961
|
+
this._log.info('updateBackupSchedule response %j', response);
|
|
962
|
+
return [response, options, rawResponse];
|
|
963
|
+
})
|
|
964
|
+
.catch((error) => {
|
|
965
|
+
if (error &&
|
|
966
|
+
'statusDetails' in error &&
|
|
967
|
+
error.statusDetails instanceof Array) {
|
|
968
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
969
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
970
|
+
}
|
|
971
|
+
throw error;
|
|
972
|
+
});
|
|
667
973
|
}
|
|
668
974
|
deleteBackupSchedule(request, optionsOrCallback, callback) {
|
|
669
|
-
var _a;
|
|
670
975
|
request = request || {};
|
|
671
976
|
let options;
|
|
672
977
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -681,13 +986,74 @@ class DatabaseAdminClient {
|
|
|
681
986
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
682
987
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
683
988
|
this._gaxModule.routingHeader.fromParams({
|
|
684
|
-
name:
|
|
989
|
+
name: request.name ?? '',
|
|
685
990
|
});
|
|
686
|
-
this.initialize()
|
|
687
|
-
|
|
991
|
+
this.initialize().catch(err => {
|
|
992
|
+
throw err;
|
|
993
|
+
});
|
|
994
|
+
this._log.info('deleteBackupSchedule request %j', request);
|
|
995
|
+
const wrappedCallback = callback
|
|
996
|
+
? (error, response, options, rawResponse) => {
|
|
997
|
+
this._log.info('deleteBackupSchedule response %j', response);
|
|
998
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
999
|
+
}
|
|
1000
|
+
: undefined;
|
|
1001
|
+
return this.innerApiCalls
|
|
1002
|
+
.deleteBackupSchedule(request, options, wrappedCallback)
|
|
1003
|
+
?.then(([response, options, rawResponse]) => {
|
|
1004
|
+
this._log.info('deleteBackupSchedule response %j', response);
|
|
1005
|
+
return [response, options, rawResponse];
|
|
1006
|
+
})
|
|
1007
|
+
.catch((error) => {
|
|
1008
|
+
if (error &&
|
|
1009
|
+
'statusDetails' in error &&
|
|
1010
|
+
error.statusDetails instanceof Array) {
|
|
1011
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
1012
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
1013
|
+
}
|
|
1014
|
+
throw error;
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
internalUpdateGraphOperation(request, optionsOrCallback, callback) {
|
|
1018
|
+
request = request || {};
|
|
1019
|
+
let options;
|
|
1020
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1021
|
+
callback = optionsOrCallback;
|
|
1022
|
+
options = {};
|
|
1023
|
+
}
|
|
1024
|
+
else {
|
|
1025
|
+
options = optionsOrCallback;
|
|
1026
|
+
}
|
|
1027
|
+
options = options || {};
|
|
1028
|
+
options.otherArgs = options.otherArgs || {};
|
|
1029
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1030
|
+
this.initialize().catch(err => {
|
|
1031
|
+
throw err;
|
|
1032
|
+
});
|
|
1033
|
+
this._log.info('internalUpdateGraphOperation request %j', request);
|
|
1034
|
+
const wrappedCallback = callback
|
|
1035
|
+
? (error, response, options, rawResponse) => {
|
|
1036
|
+
this._log.info('internalUpdateGraphOperation response %j', response);
|
|
1037
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
1038
|
+
}
|
|
1039
|
+
: undefined;
|
|
1040
|
+
return this.innerApiCalls
|
|
1041
|
+
.internalUpdateGraphOperation(request, options, wrappedCallback)
|
|
1042
|
+
?.then(([response, options, rawResponse]) => {
|
|
1043
|
+
this._log.info('internalUpdateGraphOperation response %j', response);
|
|
1044
|
+
return [response, options, rawResponse];
|
|
1045
|
+
})
|
|
1046
|
+
.catch((error) => {
|
|
1047
|
+
if (error &&
|
|
1048
|
+
'statusDetails' in error &&
|
|
1049
|
+
error.statusDetails instanceof Array) {
|
|
1050
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
1051
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
1052
|
+
}
|
|
1053
|
+
throw error;
|
|
1054
|
+
});
|
|
688
1055
|
}
|
|
689
1056
|
createDatabase(request, optionsOrCallback, callback) {
|
|
690
|
-
var _a;
|
|
691
1057
|
request = request || {};
|
|
692
1058
|
let options;
|
|
693
1059
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -702,10 +1068,24 @@ class DatabaseAdminClient {
|
|
|
702
1068
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
703
1069
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
704
1070
|
this._gaxModule.routingHeader.fromParams({
|
|
705
|
-
parent:
|
|
1071
|
+
parent: request.parent ?? '',
|
|
706
1072
|
});
|
|
707
|
-
this.initialize()
|
|
708
|
-
|
|
1073
|
+
this.initialize().catch(err => {
|
|
1074
|
+
throw err;
|
|
1075
|
+
});
|
|
1076
|
+
const wrappedCallback = callback
|
|
1077
|
+
? (error, response, rawResponse, _) => {
|
|
1078
|
+
this._log.info('createDatabase response %j', rawResponse);
|
|
1079
|
+
callback(error, response, rawResponse, _); // We verified callback above.
|
|
1080
|
+
}
|
|
1081
|
+
: undefined;
|
|
1082
|
+
this._log.info('createDatabase request %j', request);
|
|
1083
|
+
return this.innerApiCalls
|
|
1084
|
+
.createDatabase(request, options, wrappedCallback)
|
|
1085
|
+
?.then(([response, rawResponse, _]) => {
|
|
1086
|
+
this._log.info('createDatabase response %j', rawResponse);
|
|
1087
|
+
return [response, rawResponse, _];
|
|
1088
|
+
});
|
|
709
1089
|
}
|
|
710
1090
|
/**
|
|
711
1091
|
* Check the status of the long running operation returned by `createDatabase()`.
|
|
@@ -717,13 +1097,13 @@ class DatabaseAdminClient {
|
|
|
717
1097
|
* for more details and examples.
|
|
718
1098
|
*/
|
|
719
1099
|
async checkCreateDatabaseProgress(name) {
|
|
1100
|
+
this._log.info('createDatabase long-running');
|
|
720
1101
|
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
721
1102
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
722
1103
|
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDatabase, this._gaxModule.createDefaultBackoffSettings());
|
|
723
1104
|
return decodeOperation;
|
|
724
1105
|
}
|
|
725
1106
|
updateDatabase(request, optionsOrCallback, callback) {
|
|
726
|
-
var _a;
|
|
727
1107
|
request = request || {};
|
|
728
1108
|
let options;
|
|
729
1109
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -738,10 +1118,24 @@ class DatabaseAdminClient {
|
|
|
738
1118
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
739
1119
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
740
1120
|
this._gaxModule.routingHeader.fromParams({
|
|
741
|
-
'database.name':
|
|
1121
|
+
'database.name': request.database.name ?? '',
|
|
742
1122
|
});
|
|
743
|
-
this.initialize()
|
|
744
|
-
|
|
1123
|
+
this.initialize().catch(err => {
|
|
1124
|
+
throw err;
|
|
1125
|
+
});
|
|
1126
|
+
const wrappedCallback = callback
|
|
1127
|
+
? (error, response, rawResponse, _) => {
|
|
1128
|
+
this._log.info('updateDatabase response %j', rawResponse);
|
|
1129
|
+
callback(error, response, rawResponse, _); // We verified callback above.
|
|
1130
|
+
}
|
|
1131
|
+
: undefined;
|
|
1132
|
+
this._log.info('updateDatabase request %j', request);
|
|
1133
|
+
return this.innerApiCalls
|
|
1134
|
+
.updateDatabase(request, options, wrappedCallback)
|
|
1135
|
+
?.then(([response, rawResponse, _]) => {
|
|
1136
|
+
this._log.info('updateDatabase response %j', rawResponse);
|
|
1137
|
+
return [response, rawResponse, _];
|
|
1138
|
+
});
|
|
745
1139
|
}
|
|
746
1140
|
/**
|
|
747
1141
|
* Check the status of the long running operation returned by `updateDatabase()`.
|
|
@@ -753,13 +1147,13 @@ class DatabaseAdminClient {
|
|
|
753
1147
|
* for more details and examples.
|
|
754
1148
|
*/
|
|
755
1149
|
async checkUpdateDatabaseProgress(name) {
|
|
1150
|
+
this._log.info('updateDatabase long-running');
|
|
756
1151
|
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
757
1152
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
758
1153
|
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateDatabase, this._gaxModule.createDefaultBackoffSettings());
|
|
759
1154
|
return decodeOperation;
|
|
760
1155
|
}
|
|
761
1156
|
updateDatabaseDdl(request, optionsOrCallback, callback) {
|
|
762
|
-
var _a;
|
|
763
1157
|
request = request || {};
|
|
764
1158
|
let options;
|
|
765
1159
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -774,10 +1168,24 @@ class DatabaseAdminClient {
|
|
|
774
1168
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
775
1169
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
776
1170
|
this._gaxModule.routingHeader.fromParams({
|
|
777
|
-
database:
|
|
1171
|
+
database: request.database ?? '',
|
|
778
1172
|
});
|
|
779
|
-
this.initialize()
|
|
780
|
-
|
|
1173
|
+
this.initialize().catch(err => {
|
|
1174
|
+
throw err;
|
|
1175
|
+
});
|
|
1176
|
+
const wrappedCallback = callback
|
|
1177
|
+
? (error, response, rawResponse, _) => {
|
|
1178
|
+
this._log.info('updateDatabaseDdl response %j', rawResponse);
|
|
1179
|
+
callback(error, response, rawResponse, _); // We verified callback above.
|
|
1180
|
+
}
|
|
1181
|
+
: undefined;
|
|
1182
|
+
this._log.info('updateDatabaseDdl request %j', request);
|
|
1183
|
+
return this.innerApiCalls
|
|
1184
|
+
.updateDatabaseDdl(request, options, wrappedCallback)
|
|
1185
|
+
?.then(([response, rawResponse, _]) => {
|
|
1186
|
+
this._log.info('updateDatabaseDdl response %j', rawResponse);
|
|
1187
|
+
return [response, rawResponse, _];
|
|
1188
|
+
});
|
|
781
1189
|
}
|
|
782
1190
|
/**
|
|
783
1191
|
* Check the status of the long running operation returned by `updateDatabaseDdl()`.
|
|
@@ -789,13 +1197,13 @@ class DatabaseAdminClient {
|
|
|
789
1197
|
* for more details and examples.
|
|
790
1198
|
*/
|
|
791
1199
|
async checkUpdateDatabaseDdlProgress(name) {
|
|
1200
|
+
this._log.info('updateDatabaseDdl long-running');
|
|
792
1201
|
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
793
1202
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
794
1203
|
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateDatabaseDdl, this._gaxModule.createDefaultBackoffSettings());
|
|
795
1204
|
return decodeOperation;
|
|
796
1205
|
}
|
|
797
1206
|
createBackup(request, optionsOrCallback, callback) {
|
|
798
|
-
var _a;
|
|
799
1207
|
request = request || {};
|
|
800
1208
|
let options;
|
|
801
1209
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -810,10 +1218,24 @@ class DatabaseAdminClient {
|
|
|
810
1218
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
811
1219
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
812
1220
|
this._gaxModule.routingHeader.fromParams({
|
|
813
|
-
parent:
|
|
1221
|
+
parent: request.parent ?? '',
|
|
814
1222
|
});
|
|
815
|
-
this.initialize()
|
|
816
|
-
|
|
1223
|
+
this.initialize().catch(err => {
|
|
1224
|
+
throw err;
|
|
1225
|
+
});
|
|
1226
|
+
const wrappedCallback = callback
|
|
1227
|
+
? (error, response, rawResponse, _) => {
|
|
1228
|
+
this._log.info('createBackup response %j', rawResponse);
|
|
1229
|
+
callback(error, response, rawResponse, _); // We verified callback above.
|
|
1230
|
+
}
|
|
1231
|
+
: undefined;
|
|
1232
|
+
this._log.info('createBackup request %j', request);
|
|
1233
|
+
return this.innerApiCalls
|
|
1234
|
+
.createBackup(request, options, wrappedCallback)
|
|
1235
|
+
?.then(([response, rawResponse, _]) => {
|
|
1236
|
+
this._log.info('createBackup response %j', rawResponse);
|
|
1237
|
+
return [response, rawResponse, _];
|
|
1238
|
+
});
|
|
817
1239
|
}
|
|
818
1240
|
/**
|
|
819
1241
|
* Check the status of the long running operation returned by `createBackup()`.
|
|
@@ -825,13 +1247,13 @@ class DatabaseAdminClient {
|
|
|
825
1247
|
* for more details and examples.
|
|
826
1248
|
*/
|
|
827
1249
|
async checkCreateBackupProgress(name) {
|
|
1250
|
+
this._log.info('createBackup long-running');
|
|
828
1251
|
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
829
1252
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
830
1253
|
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackup, this._gaxModule.createDefaultBackoffSettings());
|
|
831
1254
|
return decodeOperation;
|
|
832
1255
|
}
|
|
833
1256
|
copyBackup(request, optionsOrCallback, callback) {
|
|
834
|
-
var _a;
|
|
835
1257
|
request = request || {};
|
|
836
1258
|
let options;
|
|
837
1259
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -846,10 +1268,24 @@ class DatabaseAdminClient {
|
|
|
846
1268
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
847
1269
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
848
1270
|
this._gaxModule.routingHeader.fromParams({
|
|
849
|
-
parent:
|
|
1271
|
+
parent: request.parent ?? '',
|
|
850
1272
|
});
|
|
851
|
-
this.initialize()
|
|
852
|
-
|
|
1273
|
+
this.initialize().catch(err => {
|
|
1274
|
+
throw err;
|
|
1275
|
+
});
|
|
1276
|
+
const wrappedCallback = callback
|
|
1277
|
+
? (error, response, rawResponse, _) => {
|
|
1278
|
+
this._log.info('copyBackup response %j', rawResponse);
|
|
1279
|
+
callback(error, response, rawResponse, _); // We verified callback above.
|
|
1280
|
+
}
|
|
1281
|
+
: undefined;
|
|
1282
|
+
this._log.info('copyBackup request %j', request);
|
|
1283
|
+
return this.innerApiCalls
|
|
1284
|
+
.copyBackup(request, options, wrappedCallback)
|
|
1285
|
+
?.then(([response, rawResponse, _]) => {
|
|
1286
|
+
this._log.info('copyBackup response %j', rawResponse);
|
|
1287
|
+
return [response, rawResponse, _];
|
|
1288
|
+
});
|
|
853
1289
|
}
|
|
854
1290
|
/**
|
|
855
1291
|
* Check the status of the long running operation returned by `copyBackup()`.
|
|
@@ -861,13 +1297,13 @@ class DatabaseAdminClient {
|
|
|
861
1297
|
* for more details and examples.
|
|
862
1298
|
*/
|
|
863
1299
|
async checkCopyBackupProgress(name) {
|
|
1300
|
+
this._log.info('copyBackup long-running');
|
|
864
1301
|
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
865
1302
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
866
1303
|
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.copyBackup, this._gaxModule.createDefaultBackoffSettings());
|
|
867
1304
|
return decodeOperation;
|
|
868
1305
|
}
|
|
869
1306
|
restoreDatabase(request, optionsOrCallback, callback) {
|
|
870
|
-
var _a;
|
|
871
1307
|
request = request || {};
|
|
872
1308
|
let options;
|
|
873
1309
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -882,10 +1318,24 @@ class DatabaseAdminClient {
|
|
|
882
1318
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
883
1319
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
884
1320
|
this._gaxModule.routingHeader.fromParams({
|
|
885
|
-
parent:
|
|
1321
|
+
parent: request.parent ?? '',
|
|
886
1322
|
});
|
|
887
|
-
this.initialize()
|
|
888
|
-
|
|
1323
|
+
this.initialize().catch(err => {
|
|
1324
|
+
throw err;
|
|
1325
|
+
});
|
|
1326
|
+
const wrappedCallback = callback
|
|
1327
|
+
? (error, response, rawResponse, _) => {
|
|
1328
|
+
this._log.info('restoreDatabase response %j', rawResponse);
|
|
1329
|
+
callback(error, response, rawResponse, _); // We verified callback above.
|
|
1330
|
+
}
|
|
1331
|
+
: undefined;
|
|
1332
|
+
this._log.info('restoreDatabase request %j', request);
|
|
1333
|
+
return this.innerApiCalls
|
|
1334
|
+
.restoreDatabase(request, options, wrappedCallback)
|
|
1335
|
+
?.then(([response, rawResponse, _]) => {
|
|
1336
|
+
this._log.info('restoreDatabase response %j', rawResponse);
|
|
1337
|
+
return [response, rawResponse, _];
|
|
1338
|
+
});
|
|
889
1339
|
}
|
|
890
1340
|
/**
|
|
891
1341
|
* Check the status of the long running operation returned by `restoreDatabase()`.
|
|
@@ -897,13 +1347,13 @@ class DatabaseAdminClient {
|
|
|
897
1347
|
* for more details and examples.
|
|
898
1348
|
*/
|
|
899
1349
|
async checkRestoreDatabaseProgress(name) {
|
|
1350
|
+
this._log.info('restoreDatabase long-running');
|
|
900
1351
|
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
901
1352
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
902
1353
|
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreDatabase, this._gaxModule.createDefaultBackoffSettings());
|
|
903
1354
|
return decodeOperation;
|
|
904
1355
|
}
|
|
905
1356
|
listDatabases(request, optionsOrCallback, callback) {
|
|
906
|
-
var _a;
|
|
907
1357
|
request = request || {};
|
|
908
1358
|
let options;
|
|
909
1359
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -918,10 +1368,24 @@ class DatabaseAdminClient {
|
|
|
918
1368
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
919
1369
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
920
1370
|
this._gaxModule.routingHeader.fromParams({
|
|
921
|
-
parent:
|
|
1371
|
+
parent: request.parent ?? '',
|
|
922
1372
|
});
|
|
923
|
-
this.initialize()
|
|
924
|
-
|
|
1373
|
+
this.initialize().catch(err => {
|
|
1374
|
+
throw err;
|
|
1375
|
+
});
|
|
1376
|
+
const wrappedCallback = callback
|
|
1377
|
+
? (error, values, nextPageRequest, rawResponse) => {
|
|
1378
|
+
this._log.info('listDatabases values %j', values);
|
|
1379
|
+
callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
|
|
1380
|
+
}
|
|
1381
|
+
: undefined;
|
|
1382
|
+
this._log.info('listDatabases request %j', request);
|
|
1383
|
+
return this.innerApiCalls
|
|
1384
|
+
.listDatabases(request, options, wrappedCallback)
|
|
1385
|
+
?.then(([response, input, output]) => {
|
|
1386
|
+
this._log.info('listDatabases values %j', response);
|
|
1387
|
+
return [response, input, output];
|
|
1388
|
+
});
|
|
925
1389
|
}
|
|
926
1390
|
/**
|
|
927
1391
|
* Equivalent to `listDatabases`, but returns a NodeJS Stream object.
|
|
@@ -950,18 +1414,20 @@ class DatabaseAdminClient {
|
|
|
950
1414
|
* for more details and examples.
|
|
951
1415
|
*/
|
|
952
1416
|
listDatabasesStream(request, options) {
|
|
953
|
-
var _a;
|
|
954
1417
|
request = request || {};
|
|
955
1418
|
options = options || {};
|
|
956
1419
|
options.otherArgs = options.otherArgs || {};
|
|
957
1420
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
958
1421
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
959
1422
|
this._gaxModule.routingHeader.fromParams({
|
|
960
|
-
parent:
|
|
1423
|
+
parent: request.parent ?? '',
|
|
961
1424
|
});
|
|
962
1425
|
const defaultCallSettings = this._defaults['listDatabases'];
|
|
963
1426
|
const callSettings = defaultCallSettings.merge(options);
|
|
964
|
-
this.initialize()
|
|
1427
|
+
this.initialize().catch(err => {
|
|
1428
|
+
throw err;
|
|
1429
|
+
});
|
|
1430
|
+
this._log.info('listDatabases stream %j', request);
|
|
965
1431
|
return this.descriptors.page.listDatabases.createStream(this.innerApiCalls.listDatabases, request, callSettings);
|
|
966
1432
|
}
|
|
967
1433
|
/**
|
|
@@ -992,22 +1458,23 @@ class DatabaseAdminClient {
|
|
|
992
1458
|
* for more details and examples.
|
|
993
1459
|
*/
|
|
994
1460
|
listDatabasesAsync(request, options) {
|
|
995
|
-
var _a;
|
|
996
1461
|
request = request || {};
|
|
997
1462
|
options = options || {};
|
|
998
1463
|
options.otherArgs = options.otherArgs || {};
|
|
999
1464
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1000
1465
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1001
1466
|
this._gaxModule.routingHeader.fromParams({
|
|
1002
|
-
parent:
|
|
1467
|
+
parent: request.parent ?? '',
|
|
1003
1468
|
});
|
|
1004
1469
|
const defaultCallSettings = this._defaults['listDatabases'];
|
|
1005
1470
|
const callSettings = defaultCallSettings.merge(options);
|
|
1006
|
-
this.initialize()
|
|
1471
|
+
this.initialize().catch(err => {
|
|
1472
|
+
throw err;
|
|
1473
|
+
});
|
|
1474
|
+
this._log.info('listDatabases iterate %j', request);
|
|
1007
1475
|
return this.descriptors.page.listDatabases.asyncIterate(this.innerApiCalls['listDatabases'], request, callSettings);
|
|
1008
1476
|
}
|
|
1009
1477
|
listBackups(request, optionsOrCallback, callback) {
|
|
1010
|
-
var _a;
|
|
1011
1478
|
request = request || {};
|
|
1012
1479
|
let options;
|
|
1013
1480
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -1022,10 +1489,24 @@ class DatabaseAdminClient {
|
|
|
1022
1489
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1023
1490
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1024
1491
|
this._gaxModule.routingHeader.fromParams({
|
|
1025
|
-
parent:
|
|
1492
|
+
parent: request.parent ?? '',
|
|
1026
1493
|
});
|
|
1027
|
-
this.initialize()
|
|
1028
|
-
|
|
1494
|
+
this.initialize().catch(err => {
|
|
1495
|
+
throw err;
|
|
1496
|
+
});
|
|
1497
|
+
const wrappedCallback = callback
|
|
1498
|
+
? (error, values, nextPageRequest, rawResponse) => {
|
|
1499
|
+
this._log.info('listBackups values %j', values);
|
|
1500
|
+
callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
|
|
1501
|
+
}
|
|
1502
|
+
: undefined;
|
|
1503
|
+
this._log.info('listBackups request %j', request);
|
|
1504
|
+
return this.innerApiCalls
|
|
1505
|
+
.listBackups(request, options, wrappedCallback)
|
|
1506
|
+
?.then(([response, input, output]) => {
|
|
1507
|
+
this._log.info('listBackups values %j', response);
|
|
1508
|
+
return [response, input, output];
|
|
1509
|
+
});
|
|
1029
1510
|
}
|
|
1030
1511
|
/**
|
|
1031
1512
|
* Equivalent to `listBackups`, but returns a NodeJS Stream object.
|
|
@@ -1096,18 +1577,20 @@ class DatabaseAdminClient {
|
|
|
1096
1577
|
* for more details and examples.
|
|
1097
1578
|
*/
|
|
1098
1579
|
listBackupsStream(request, options) {
|
|
1099
|
-
var _a;
|
|
1100
1580
|
request = request || {};
|
|
1101
1581
|
options = options || {};
|
|
1102
1582
|
options.otherArgs = options.otherArgs || {};
|
|
1103
1583
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1104
1584
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1105
1585
|
this._gaxModule.routingHeader.fromParams({
|
|
1106
|
-
parent:
|
|
1586
|
+
parent: request.parent ?? '',
|
|
1107
1587
|
});
|
|
1108
1588
|
const defaultCallSettings = this._defaults['listBackups'];
|
|
1109
1589
|
const callSettings = defaultCallSettings.merge(options);
|
|
1110
|
-
this.initialize()
|
|
1590
|
+
this.initialize().catch(err => {
|
|
1591
|
+
throw err;
|
|
1592
|
+
});
|
|
1593
|
+
this._log.info('listBackups stream %j', request);
|
|
1111
1594
|
return this.descriptors.page.listBackups.createStream(this.innerApiCalls.listBackups, request, callSettings);
|
|
1112
1595
|
}
|
|
1113
1596
|
/**
|
|
@@ -1180,22 +1663,23 @@ class DatabaseAdminClient {
|
|
|
1180
1663
|
* for more details and examples.
|
|
1181
1664
|
*/
|
|
1182
1665
|
listBackupsAsync(request, options) {
|
|
1183
|
-
var _a;
|
|
1184
1666
|
request = request || {};
|
|
1185
1667
|
options = options || {};
|
|
1186
1668
|
options.otherArgs = options.otherArgs || {};
|
|
1187
1669
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1188
1670
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1189
1671
|
this._gaxModule.routingHeader.fromParams({
|
|
1190
|
-
parent:
|
|
1672
|
+
parent: request.parent ?? '',
|
|
1191
1673
|
});
|
|
1192
1674
|
const defaultCallSettings = this._defaults['listBackups'];
|
|
1193
1675
|
const callSettings = defaultCallSettings.merge(options);
|
|
1194
|
-
this.initialize()
|
|
1676
|
+
this.initialize().catch(err => {
|
|
1677
|
+
throw err;
|
|
1678
|
+
});
|
|
1679
|
+
this._log.info('listBackups iterate %j', request);
|
|
1195
1680
|
return this.descriptors.page.listBackups.asyncIterate(this.innerApiCalls['listBackups'], request, callSettings);
|
|
1196
1681
|
}
|
|
1197
1682
|
listDatabaseOperations(request, optionsOrCallback, callback) {
|
|
1198
|
-
var _a;
|
|
1199
1683
|
request = request || {};
|
|
1200
1684
|
let options;
|
|
1201
1685
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -1210,10 +1694,24 @@ class DatabaseAdminClient {
|
|
|
1210
1694
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1211
1695
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1212
1696
|
this._gaxModule.routingHeader.fromParams({
|
|
1213
|
-
parent:
|
|
1697
|
+
parent: request.parent ?? '',
|
|
1214
1698
|
});
|
|
1215
|
-
this.initialize()
|
|
1216
|
-
|
|
1699
|
+
this.initialize().catch(err => {
|
|
1700
|
+
throw err;
|
|
1701
|
+
});
|
|
1702
|
+
const wrappedCallback = callback
|
|
1703
|
+
? (error, values, nextPageRequest, rawResponse) => {
|
|
1704
|
+
this._log.info('listDatabaseOperations values %j', values);
|
|
1705
|
+
callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
|
|
1706
|
+
}
|
|
1707
|
+
: undefined;
|
|
1708
|
+
this._log.info('listDatabaseOperations request %j', request);
|
|
1709
|
+
return this.innerApiCalls
|
|
1710
|
+
.listDatabaseOperations(request, options, wrappedCallback)
|
|
1711
|
+
?.then(([response, input, output]) => {
|
|
1712
|
+
this._log.info('listDatabaseOperations values %j', response);
|
|
1713
|
+
return [response, input, output];
|
|
1714
|
+
});
|
|
1217
1715
|
}
|
|
1218
1716
|
/**
|
|
1219
1717
|
* Equivalent to `listDatabaseOperations`, but returns a NodeJS Stream object.
|
|
@@ -1289,18 +1787,20 @@ class DatabaseAdminClient {
|
|
|
1289
1787
|
* for more details and examples.
|
|
1290
1788
|
*/
|
|
1291
1789
|
listDatabaseOperationsStream(request, options) {
|
|
1292
|
-
var _a;
|
|
1293
1790
|
request = request || {};
|
|
1294
1791
|
options = options || {};
|
|
1295
1792
|
options.otherArgs = options.otherArgs || {};
|
|
1296
1793
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1297
1794
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1298
1795
|
this._gaxModule.routingHeader.fromParams({
|
|
1299
|
-
parent:
|
|
1796
|
+
parent: request.parent ?? '',
|
|
1300
1797
|
});
|
|
1301
1798
|
const defaultCallSettings = this._defaults['listDatabaseOperations'];
|
|
1302
1799
|
const callSettings = defaultCallSettings.merge(options);
|
|
1303
|
-
this.initialize()
|
|
1800
|
+
this.initialize().catch(err => {
|
|
1801
|
+
throw err;
|
|
1802
|
+
});
|
|
1803
|
+
this._log.info('listDatabaseOperations stream %j', request);
|
|
1304
1804
|
return this.descriptors.page.listDatabaseOperations.createStream(this.innerApiCalls.listDatabaseOperations, request, callSettings);
|
|
1305
1805
|
}
|
|
1306
1806
|
/**
|
|
@@ -1378,22 +1878,23 @@ class DatabaseAdminClient {
|
|
|
1378
1878
|
* for more details and examples.
|
|
1379
1879
|
*/
|
|
1380
1880
|
listDatabaseOperationsAsync(request, options) {
|
|
1381
|
-
var _a;
|
|
1382
1881
|
request = request || {};
|
|
1383
1882
|
options = options || {};
|
|
1384
1883
|
options.otherArgs = options.otherArgs || {};
|
|
1385
1884
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1386
1885
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1387
1886
|
this._gaxModule.routingHeader.fromParams({
|
|
1388
|
-
parent:
|
|
1887
|
+
parent: request.parent ?? '',
|
|
1389
1888
|
});
|
|
1390
1889
|
const defaultCallSettings = this._defaults['listDatabaseOperations'];
|
|
1391
1890
|
const callSettings = defaultCallSettings.merge(options);
|
|
1392
|
-
this.initialize()
|
|
1891
|
+
this.initialize().catch(err => {
|
|
1892
|
+
throw err;
|
|
1893
|
+
});
|
|
1894
|
+
this._log.info('listDatabaseOperations iterate %j', request);
|
|
1393
1895
|
return this.descriptors.page.listDatabaseOperations.asyncIterate(this.innerApiCalls['listDatabaseOperations'], request, callSettings);
|
|
1394
1896
|
}
|
|
1395
1897
|
listBackupOperations(request, optionsOrCallback, callback) {
|
|
1396
|
-
var _a;
|
|
1397
1898
|
request = request || {};
|
|
1398
1899
|
let options;
|
|
1399
1900
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -1408,10 +1909,24 @@ class DatabaseAdminClient {
|
|
|
1408
1909
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1409
1910
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1410
1911
|
this._gaxModule.routingHeader.fromParams({
|
|
1411
|
-
parent:
|
|
1912
|
+
parent: request.parent ?? '',
|
|
1412
1913
|
});
|
|
1413
|
-
this.initialize()
|
|
1414
|
-
|
|
1914
|
+
this.initialize().catch(err => {
|
|
1915
|
+
throw err;
|
|
1916
|
+
});
|
|
1917
|
+
const wrappedCallback = callback
|
|
1918
|
+
? (error, values, nextPageRequest, rawResponse) => {
|
|
1919
|
+
this._log.info('listBackupOperations values %j', values);
|
|
1920
|
+
callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
|
|
1921
|
+
}
|
|
1922
|
+
: undefined;
|
|
1923
|
+
this._log.info('listBackupOperations request %j', request);
|
|
1924
|
+
return this.innerApiCalls
|
|
1925
|
+
.listBackupOperations(request, options, wrappedCallback)
|
|
1926
|
+
?.then(([response, input, output]) => {
|
|
1927
|
+
this._log.info('listBackupOperations values %j', response);
|
|
1928
|
+
return [response, input, output];
|
|
1929
|
+
});
|
|
1415
1930
|
}
|
|
1416
1931
|
/**
|
|
1417
1932
|
* Equivalent to `listBackupOperations`, but returns a NodeJS Stream object.
|
|
@@ -1512,18 +2027,20 @@ class DatabaseAdminClient {
|
|
|
1512
2027
|
* for more details and examples.
|
|
1513
2028
|
*/
|
|
1514
2029
|
listBackupOperationsStream(request, options) {
|
|
1515
|
-
var _a;
|
|
1516
2030
|
request = request || {};
|
|
1517
2031
|
options = options || {};
|
|
1518
2032
|
options.otherArgs = options.otherArgs || {};
|
|
1519
2033
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1520
2034
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1521
2035
|
this._gaxModule.routingHeader.fromParams({
|
|
1522
|
-
parent:
|
|
2036
|
+
parent: request.parent ?? '',
|
|
1523
2037
|
});
|
|
1524
2038
|
const defaultCallSettings = this._defaults['listBackupOperations'];
|
|
1525
2039
|
const callSettings = defaultCallSettings.merge(options);
|
|
1526
|
-
this.initialize()
|
|
2040
|
+
this.initialize().catch(err => {
|
|
2041
|
+
throw err;
|
|
2042
|
+
});
|
|
2043
|
+
this._log.info('listBackupOperations stream %j', request);
|
|
1527
2044
|
return this.descriptors.page.listBackupOperations.createStream(this.innerApiCalls.listBackupOperations, request, callSettings);
|
|
1528
2045
|
}
|
|
1529
2046
|
/**
|
|
@@ -1626,22 +2143,23 @@ class DatabaseAdminClient {
|
|
|
1626
2143
|
* for more details and examples.
|
|
1627
2144
|
*/
|
|
1628
2145
|
listBackupOperationsAsync(request, options) {
|
|
1629
|
-
var _a;
|
|
1630
2146
|
request = request || {};
|
|
1631
2147
|
options = options || {};
|
|
1632
2148
|
options.otherArgs = options.otherArgs || {};
|
|
1633
2149
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1634
2150
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1635
2151
|
this._gaxModule.routingHeader.fromParams({
|
|
1636
|
-
parent:
|
|
2152
|
+
parent: request.parent ?? '',
|
|
1637
2153
|
});
|
|
1638
2154
|
const defaultCallSettings = this._defaults['listBackupOperations'];
|
|
1639
2155
|
const callSettings = defaultCallSettings.merge(options);
|
|
1640
|
-
this.initialize()
|
|
2156
|
+
this.initialize().catch(err => {
|
|
2157
|
+
throw err;
|
|
2158
|
+
});
|
|
2159
|
+
this._log.info('listBackupOperations iterate %j', request);
|
|
1641
2160
|
return this.descriptors.page.listBackupOperations.asyncIterate(this.innerApiCalls['listBackupOperations'], request, callSettings);
|
|
1642
2161
|
}
|
|
1643
2162
|
listDatabaseRoles(request, optionsOrCallback, callback) {
|
|
1644
|
-
var _a;
|
|
1645
2163
|
request = request || {};
|
|
1646
2164
|
let options;
|
|
1647
2165
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -1656,10 +2174,24 @@ class DatabaseAdminClient {
|
|
|
1656
2174
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1657
2175
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1658
2176
|
this._gaxModule.routingHeader.fromParams({
|
|
1659
|
-
parent:
|
|
2177
|
+
parent: request.parent ?? '',
|
|
1660
2178
|
});
|
|
1661
|
-
this.initialize()
|
|
1662
|
-
|
|
2179
|
+
this.initialize().catch(err => {
|
|
2180
|
+
throw err;
|
|
2181
|
+
});
|
|
2182
|
+
const wrappedCallback = callback
|
|
2183
|
+
? (error, values, nextPageRequest, rawResponse) => {
|
|
2184
|
+
this._log.info('listDatabaseRoles values %j', values);
|
|
2185
|
+
callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
|
|
2186
|
+
}
|
|
2187
|
+
: undefined;
|
|
2188
|
+
this._log.info('listDatabaseRoles request %j', request);
|
|
2189
|
+
return this.innerApiCalls
|
|
2190
|
+
.listDatabaseRoles(request, options, wrappedCallback)
|
|
2191
|
+
?.then(([response, input, output]) => {
|
|
2192
|
+
this._log.info('listDatabaseRoles values %j', response);
|
|
2193
|
+
return [response, input, output];
|
|
2194
|
+
});
|
|
1663
2195
|
}
|
|
1664
2196
|
/**
|
|
1665
2197
|
* Equivalent to `listDatabaseRoles`, but returns a NodeJS Stream object.
|
|
@@ -1689,18 +2221,20 @@ class DatabaseAdminClient {
|
|
|
1689
2221
|
* for more details and examples.
|
|
1690
2222
|
*/
|
|
1691
2223
|
listDatabaseRolesStream(request, options) {
|
|
1692
|
-
var _a;
|
|
1693
2224
|
request = request || {};
|
|
1694
2225
|
options = options || {};
|
|
1695
2226
|
options.otherArgs = options.otherArgs || {};
|
|
1696
2227
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1697
2228
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1698
2229
|
this._gaxModule.routingHeader.fromParams({
|
|
1699
|
-
parent:
|
|
2230
|
+
parent: request.parent ?? '',
|
|
1700
2231
|
});
|
|
1701
2232
|
const defaultCallSettings = this._defaults['listDatabaseRoles'];
|
|
1702
2233
|
const callSettings = defaultCallSettings.merge(options);
|
|
1703
|
-
this.initialize()
|
|
2234
|
+
this.initialize().catch(err => {
|
|
2235
|
+
throw err;
|
|
2236
|
+
});
|
|
2237
|
+
this._log.info('listDatabaseRoles stream %j', request);
|
|
1704
2238
|
return this.descriptors.page.listDatabaseRoles.createStream(this.innerApiCalls.listDatabaseRoles, request, callSettings);
|
|
1705
2239
|
}
|
|
1706
2240
|
/**
|
|
@@ -1732,22 +2266,23 @@ class DatabaseAdminClient {
|
|
|
1732
2266
|
* for more details and examples.
|
|
1733
2267
|
*/
|
|
1734
2268
|
listDatabaseRolesAsync(request, options) {
|
|
1735
|
-
var _a;
|
|
1736
2269
|
request = request || {};
|
|
1737
2270
|
options = options || {};
|
|
1738
2271
|
options.otherArgs = options.otherArgs || {};
|
|
1739
2272
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1740
2273
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1741
2274
|
this._gaxModule.routingHeader.fromParams({
|
|
1742
|
-
parent:
|
|
2275
|
+
parent: request.parent ?? '',
|
|
1743
2276
|
});
|
|
1744
2277
|
const defaultCallSettings = this._defaults['listDatabaseRoles'];
|
|
1745
2278
|
const callSettings = defaultCallSettings.merge(options);
|
|
1746
|
-
this.initialize()
|
|
2279
|
+
this.initialize().catch(err => {
|
|
2280
|
+
throw err;
|
|
2281
|
+
});
|
|
2282
|
+
this._log.info('listDatabaseRoles iterate %j', request);
|
|
1747
2283
|
return this.descriptors.page.listDatabaseRoles.asyncIterate(this.innerApiCalls['listDatabaseRoles'], request, callSettings);
|
|
1748
2284
|
}
|
|
1749
2285
|
listBackupSchedules(request, optionsOrCallback, callback) {
|
|
1750
|
-
var _a;
|
|
1751
2286
|
request = request || {};
|
|
1752
2287
|
let options;
|
|
1753
2288
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -1762,10 +2297,24 @@ class DatabaseAdminClient {
|
|
|
1762
2297
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1763
2298
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1764
2299
|
this._gaxModule.routingHeader.fromParams({
|
|
1765
|
-
parent:
|
|
2300
|
+
parent: request.parent ?? '',
|
|
1766
2301
|
});
|
|
1767
|
-
this.initialize()
|
|
1768
|
-
|
|
2302
|
+
this.initialize().catch(err => {
|
|
2303
|
+
throw err;
|
|
2304
|
+
});
|
|
2305
|
+
const wrappedCallback = callback
|
|
2306
|
+
? (error, values, nextPageRequest, rawResponse) => {
|
|
2307
|
+
this._log.info('listBackupSchedules values %j', values);
|
|
2308
|
+
callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
|
|
2309
|
+
}
|
|
2310
|
+
: undefined;
|
|
2311
|
+
this._log.info('listBackupSchedules request %j', request);
|
|
2312
|
+
return this.innerApiCalls
|
|
2313
|
+
.listBackupSchedules(request, options, wrappedCallback)
|
|
2314
|
+
?.then(([response, input, output]) => {
|
|
2315
|
+
this._log.info('listBackupSchedules values %j', response);
|
|
2316
|
+
return [response, input, output];
|
|
2317
|
+
});
|
|
1769
2318
|
}
|
|
1770
2319
|
/**
|
|
1771
2320
|
* Equivalent to `listBackupSchedules`, but returns a NodeJS Stream object.
|
|
@@ -1796,18 +2345,20 @@ class DatabaseAdminClient {
|
|
|
1796
2345
|
* for more details and examples.
|
|
1797
2346
|
*/
|
|
1798
2347
|
listBackupSchedulesStream(request, options) {
|
|
1799
|
-
var _a;
|
|
1800
2348
|
request = request || {};
|
|
1801
2349
|
options = options || {};
|
|
1802
2350
|
options.otherArgs = options.otherArgs || {};
|
|
1803
2351
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1804
2352
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1805
2353
|
this._gaxModule.routingHeader.fromParams({
|
|
1806
|
-
parent:
|
|
2354
|
+
parent: request.parent ?? '',
|
|
1807
2355
|
});
|
|
1808
2356
|
const defaultCallSettings = this._defaults['listBackupSchedules'];
|
|
1809
2357
|
const callSettings = defaultCallSettings.merge(options);
|
|
1810
|
-
this.initialize()
|
|
2358
|
+
this.initialize().catch(err => {
|
|
2359
|
+
throw err;
|
|
2360
|
+
});
|
|
2361
|
+
this._log.info('listBackupSchedules stream %j', request);
|
|
1811
2362
|
return this.descriptors.page.listBackupSchedules.createStream(this.innerApiCalls.listBackupSchedules, request, callSettings);
|
|
1812
2363
|
}
|
|
1813
2364
|
/**
|
|
@@ -1840,18 +2391,20 @@ class DatabaseAdminClient {
|
|
|
1840
2391
|
* for more details and examples.
|
|
1841
2392
|
*/
|
|
1842
2393
|
listBackupSchedulesAsync(request, options) {
|
|
1843
|
-
var _a;
|
|
1844
2394
|
request = request || {};
|
|
1845
2395
|
options = options || {};
|
|
1846
2396
|
options.otherArgs = options.otherArgs || {};
|
|
1847
2397
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1848
2398
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1849
2399
|
this._gaxModule.routingHeader.fromParams({
|
|
1850
|
-
parent:
|
|
2400
|
+
parent: request.parent ?? '',
|
|
1851
2401
|
});
|
|
1852
2402
|
const defaultCallSettings = this._defaults['listBackupSchedules'];
|
|
1853
2403
|
const callSettings = defaultCallSettings.merge(options);
|
|
1854
|
-
this.initialize()
|
|
2404
|
+
this.initialize().catch(err => {
|
|
2405
|
+
throw err;
|
|
2406
|
+
});
|
|
2407
|
+
this._log.info('listBackupSchedules iterate %j', request);
|
|
1855
2408
|
return this.descriptors.page.listBackupSchedules.asyncIterate(this.innerApiCalls['listBackupSchedules'], request, callSettings);
|
|
1856
2409
|
}
|
|
1857
2410
|
/**
|
|
@@ -1885,7 +2438,6 @@ class DatabaseAdminClient {
|
|
|
1885
2438
|
* ```
|
|
1886
2439
|
*/
|
|
1887
2440
|
getOperation(request, optionsOrCallback, callback) {
|
|
1888
|
-
var _a;
|
|
1889
2441
|
let options;
|
|
1890
2442
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1891
2443
|
callback = optionsOrCallback;
|
|
@@ -1899,7 +2451,7 @@ class DatabaseAdminClient {
|
|
|
1899
2451
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1900
2452
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1901
2453
|
this._gaxModule.routingHeader.fromParams({
|
|
1902
|
-
name:
|
|
2454
|
+
name: request.name ?? '',
|
|
1903
2455
|
});
|
|
1904
2456
|
return this.operationsClient.getOperation(request, options, callback);
|
|
1905
2457
|
}
|
|
@@ -1934,13 +2486,12 @@ class DatabaseAdminClient {
|
|
|
1934
2486
|
* ```
|
|
1935
2487
|
*/
|
|
1936
2488
|
listOperationsAsync(request, options) {
|
|
1937
|
-
var _a;
|
|
1938
2489
|
options = options || {};
|
|
1939
2490
|
options.otherArgs = options.otherArgs || {};
|
|
1940
2491
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1941
2492
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1942
2493
|
this._gaxModule.routingHeader.fromParams({
|
|
1943
|
-
name:
|
|
2494
|
+
name: request.name ?? '',
|
|
1944
2495
|
});
|
|
1945
2496
|
return this.operationsClient.listOperationsAsync(request, options);
|
|
1946
2497
|
}
|
|
@@ -1976,7 +2527,6 @@ class DatabaseAdminClient {
|
|
|
1976
2527
|
* ```
|
|
1977
2528
|
*/
|
|
1978
2529
|
cancelOperation(request, optionsOrCallback, callback) {
|
|
1979
|
-
var _a;
|
|
1980
2530
|
let options;
|
|
1981
2531
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1982
2532
|
callback = optionsOrCallback;
|
|
@@ -1990,7 +2540,7 @@ class DatabaseAdminClient {
|
|
|
1990
2540
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1991
2541
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
1992
2542
|
this._gaxModule.routingHeader.fromParams({
|
|
1993
|
-
name:
|
|
2543
|
+
name: request.name ?? '',
|
|
1994
2544
|
});
|
|
1995
2545
|
return this.operationsClient.cancelOperation(request, options, callback);
|
|
1996
2546
|
}
|
|
@@ -2020,7 +2570,6 @@ class DatabaseAdminClient {
|
|
|
2020
2570
|
* ```
|
|
2021
2571
|
*/
|
|
2022
2572
|
deleteOperation(request, optionsOrCallback, callback) {
|
|
2023
|
-
var _a;
|
|
2024
2573
|
let options;
|
|
2025
2574
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
2026
2575
|
callback = optionsOrCallback;
|
|
@@ -2034,7 +2583,7 @@ class DatabaseAdminClient {
|
|
|
2034
2583
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
2035
2584
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
2036
2585
|
this._gaxModule.routingHeader.fromParams({
|
|
2037
|
-
name:
|
|
2586
|
+
name: request.name ?? '',
|
|
2038
2587
|
});
|
|
2039
2588
|
return this.operationsClient.deleteOperation(request, options, callback);
|
|
2040
2589
|
}
|
|
@@ -2352,9 +2901,10 @@ class DatabaseAdminClient {
|
|
|
2352
2901
|
close() {
|
|
2353
2902
|
if (this.databaseAdminStub && !this._terminated) {
|
|
2354
2903
|
return this.databaseAdminStub.then(stub => {
|
|
2904
|
+
this._log.info('ending gRPC channel');
|
|
2355
2905
|
this._terminated = true;
|
|
2356
2906
|
stub.close();
|
|
2357
|
-
this.operationsClient.close();
|
|
2907
|
+
void this.operationsClient.close();
|
|
2358
2908
|
});
|
|
2359
2909
|
}
|
|
2360
2910
|
return Promise.resolve();
|