@google-cloud/spanner 6.1.4 → 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 +15 -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 +1091 -69
- package/build/protos/protos.js +3648 -1112
- package/build/protos/protos.json +312 -1
- package/build/src/v1/database_admin_client.d.ts +11 -4
- package/build/src/v1/database_admin_client.js +111 -74
- 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 +378 -44
- 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 +68 -43
- package/package.json +7 -7
|
@@ -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.InstanceAdminClient = 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("./instance_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 Instance Admin API
|
|
@@ -87,8 +84,15 @@ class InstanceAdminClient {
|
|
|
87
84
|
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
|
|
88
85
|
* For more information, please check the
|
|
89
86
|
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
87
|
+
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
|
|
88
|
+
* need to avoid loading the default gRPC version and want to use the fallback
|
|
89
|
+
* HTTP implementation. Load only fallback version and pass it to the constructor:
|
|
90
|
+
* ```
|
|
91
|
+
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
|
|
92
|
+
* const client = new InstanceAdminClient({fallback: 'rest'}, gax);
|
|
93
|
+
* ```
|
|
90
94
|
*/
|
|
91
|
-
constructor(opts) {
|
|
95
|
+
constructor(opts, gaxInstance) {
|
|
92
96
|
var _a, _b;
|
|
93
97
|
this._terminated = false;
|
|
94
98
|
this.descriptors = {
|
|
@@ -109,8 +113,12 @@ class InstanceAdminClient {
|
|
|
109
113
|
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
|
|
110
114
|
opts['scopes'] = staticMembers.scopes;
|
|
111
115
|
}
|
|
116
|
+
// Load google-gax module synchronously if needed
|
|
117
|
+
if (!gaxInstance) {
|
|
118
|
+
gaxInstance = require('google-gax');
|
|
119
|
+
}
|
|
112
120
|
// Choose either gRPC or proto-over-HTTP implementation of google-gax.
|
|
113
|
-
this._gaxModule = opts.fallback ?
|
|
121
|
+
this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
|
|
114
122
|
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
|
|
115
123
|
this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
|
|
116
124
|
// Save options to use in initialize() method.
|
|
@@ -157,6 +165,7 @@ class InstanceAdminClient {
|
|
|
157
165
|
// pages). Denote the keys used for pagination and results.
|
|
158
166
|
this.descriptors.page = {
|
|
159
167
|
listInstanceConfigs: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instanceConfigs'),
|
|
168
|
+
listInstanceConfigOperations: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'operations'),
|
|
160
169
|
listInstances: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'),
|
|
161
170
|
};
|
|
162
171
|
const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
@@ -203,11 +212,17 @@ class InstanceAdminClient {
|
|
|
203
212
|
this.operationsClient = this._gaxModule
|
|
204
213
|
.lro(lroOptions)
|
|
205
214
|
.operationsClient(opts);
|
|
215
|
+
const createInstanceConfigResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.InstanceConfig');
|
|
216
|
+
const createInstanceConfigMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata');
|
|
217
|
+
const updateInstanceConfigResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.InstanceConfig');
|
|
218
|
+
const updateInstanceConfigMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata');
|
|
206
219
|
const createInstanceResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.Instance');
|
|
207
220
|
const createInstanceMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.CreateInstanceMetadata');
|
|
208
221
|
const updateInstanceResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.Instance');
|
|
209
222
|
const updateInstanceMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.UpdateInstanceMetadata');
|
|
210
223
|
this.descriptors.longrunning = {
|
|
224
|
+
createInstanceConfig: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createInstanceConfigResponse.decode.bind(createInstanceConfigResponse), createInstanceConfigMetadata.decode.bind(createInstanceConfigMetadata)),
|
|
225
|
+
updateInstanceConfig: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateInstanceConfigResponse.decode.bind(updateInstanceConfigResponse), updateInstanceConfigMetadata.decode.bind(updateInstanceConfigMetadata)),
|
|
211
226
|
createInstance: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createInstanceResponse.decode.bind(createInstanceResponse), createInstanceMetadata.decode.bind(createInstanceMetadata)),
|
|
212
227
|
updateInstance: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateInstanceResponse.decode.bind(updateInstanceResponse), updateInstanceMetadata.decode.bind(updateInstanceMetadata)),
|
|
213
228
|
};
|
|
@@ -218,7 +233,7 @@ class InstanceAdminClient {
|
|
|
218
233
|
// merely providing the destination and request information.
|
|
219
234
|
this.innerApiCalls = {};
|
|
220
235
|
// Add a warn function to the client constructor so it can be easily tested.
|
|
221
|
-
this.warn =
|
|
236
|
+
this.warn = this._gaxModule.warn;
|
|
222
237
|
}
|
|
223
238
|
/**
|
|
224
239
|
* Initialize the client.
|
|
@@ -247,6 +262,10 @@ class InstanceAdminClient {
|
|
|
247
262
|
const instanceAdminStubMethods = [
|
|
248
263
|
'listInstanceConfigs',
|
|
249
264
|
'getInstanceConfig',
|
|
265
|
+
'createInstanceConfig',
|
|
266
|
+
'updateInstanceConfig',
|
|
267
|
+
'deleteInstanceConfig',
|
|
268
|
+
'listInstanceConfigOperations',
|
|
250
269
|
'listInstances',
|
|
251
270
|
'getInstance',
|
|
252
271
|
'createInstance',
|
|
@@ -319,6 +338,7 @@ class InstanceAdminClient {
|
|
|
319
338
|
return this.auth.getProjectId();
|
|
320
339
|
}
|
|
321
340
|
getInstanceConfig(request, optionsOrCallback, callback) {
|
|
341
|
+
var _a;
|
|
322
342
|
request = request || {};
|
|
323
343
|
let options;
|
|
324
344
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -332,13 +352,35 @@ class InstanceAdminClient {
|
|
|
332
352
|
options.otherArgs = options.otherArgs || {};
|
|
333
353
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
334
354
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
335
|
-
|
|
336
|
-
name: request.name
|
|
355
|
+
this._gaxModule.routingHeader.fromParams({
|
|
356
|
+
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
|
|
337
357
|
});
|
|
338
358
|
this.initialize();
|
|
339
359
|
return this.innerApiCalls.getInstanceConfig(request, options, callback);
|
|
340
360
|
}
|
|
361
|
+
deleteInstanceConfig(request, optionsOrCallback, callback) {
|
|
362
|
+
var _a;
|
|
363
|
+
request = request || {};
|
|
364
|
+
let options;
|
|
365
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
366
|
+
callback = optionsOrCallback;
|
|
367
|
+
options = {};
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
options = optionsOrCallback;
|
|
371
|
+
}
|
|
372
|
+
options = options || {};
|
|
373
|
+
options.otherArgs = options.otherArgs || {};
|
|
374
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
375
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
376
|
+
this._gaxModule.routingHeader.fromParams({
|
|
377
|
+
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
|
|
378
|
+
});
|
|
379
|
+
this.initialize();
|
|
380
|
+
return this.innerApiCalls.deleteInstanceConfig(request, options, callback);
|
|
381
|
+
}
|
|
341
382
|
getInstance(request, optionsOrCallback, callback) {
|
|
383
|
+
var _a;
|
|
342
384
|
request = request || {};
|
|
343
385
|
let options;
|
|
344
386
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -352,13 +394,14 @@ class InstanceAdminClient {
|
|
|
352
394
|
options.otherArgs = options.otherArgs || {};
|
|
353
395
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
354
396
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
355
|
-
|
|
356
|
-
name: request.name
|
|
397
|
+
this._gaxModule.routingHeader.fromParams({
|
|
398
|
+
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
|
|
357
399
|
});
|
|
358
400
|
this.initialize();
|
|
359
401
|
return this.innerApiCalls.getInstance(request, options, callback);
|
|
360
402
|
}
|
|
361
403
|
deleteInstance(request, optionsOrCallback, callback) {
|
|
404
|
+
var _a;
|
|
362
405
|
request = request || {};
|
|
363
406
|
let options;
|
|
364
407
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -372,13 +415,14 @@ class InstanceAdminClient {
|
|
|
372
415
|
options.otherArgs = options.otherArgs || {};
|
|
373
416
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
374
417
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
375
|
-
|
|
376
|
-
name: request.name
|
|
418
|
+
this._gaxModule.routingHeader.fromParams({
|
|
419
|
+
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
|
|
377
420
|
});
|
|
378
421
|
this.initialize();
|
|
379
422
|
return this.innerApiCalls.deleteInstance(request, options, callback);
|
|
380
423
|
}
|
|
381
424
|
setIamPolicy(request, optionsOrCallback, callback) {
|
|
425
|
+
var _a;
|
|
382
426
|
request = request || {};
|
|
383
427
|
let options;
|
|
384
428
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -392,13 +436,14 @@ class InstanceAdminClient {
|
|
|
392
436
|
options.otherArgs = options.otherArgs || {};
|
|
393
437
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
394
438
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
395
|
-
|
|
396
|
-
resource: request.resource
|
|
439
|
+
this._gaxModule.routingHeader.fromParams({
|
|
440
|
+
resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
|
|
397
441
|
});
|
|
398
442
|
this.initialize();
|
|
399
443
|
return this.innerApiCalls.setIamPolicy(request, options, callback);
|
|
400
444
|
}
|
|
401
445
|
getIamPolicy(request, optionsOrCallback, callback) {
|
|
446
|
+
var _a;
|
|
402
447
|
request = request || {};
|
|
403
448
|
let options;
|
|
404
449
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -412,13 +457,14 @@ class InstanceAdminClient {
|
|
|
412
457
|
options.otherArgs = options.otherArgs || {};
|
|
413
458
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
414
459
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
415
|
-
|
|
416
|
-
resource: request.resource
|
|
460
|
+
this._gaxModule.routingHeader.fromParams({
|
|
461
|
+
resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
|
|
417
462
|
});
|
|
418
463
|
this.initialize();
|
|
419
464
|
return this.innerApiCalls.getIamPolicy(request, options, callback);
|
|
420
465
|
}
|
|
421
466
|
testIamPermissions(request, optionsOrCallback, callback) {
|
|
467
|
+
var _a;
|
|
422
468
|
request = request || {};
|
|
423
469
|
let options;
|
|
424
470
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -432,13 +478,92 @@ class InstanceAdminClient {
|
|
|
432
478
|
options.otherArgs = options.otherArgs || {};
|
|
433
479
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
434
480
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
435
|
-
|
|
436
|
-
resource: request.resource
|
|
481
|
+
this._gaxModule.routingHeader.fromParams({
|
|
482
|
+
resource: (_a = request.resource) !== null && _a !== void 0 ? _a : '',
|
|
437
483
|
});
|
|
438
484
|
this.initialize();
|
|
439
485
|
return this.innerApiCalls.testIamPermissions(request, options, callback);
|
|
440
486
|
}
|
|
487
|
+
createInstanceConfig(request, optionsOrCallback, callback) {
|
|
488
|
+
var _a;
|
|
489
|
+
request = request || {};
|
|
490
|
+
let options;
|
|
491
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
492
|
+
callback = optionsOrCallback;
|
|
493
|
+
options = {};
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
options = optionsOrCallback;
|
|
497
|
+
}
|
|
498
|
+
options = options || {};
|
|
499
|
+
options.otherArgs = options.otherArgs || {};
|
|
500
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
501
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
502
|
+
this._gaxModule.routingHeader.fromParams({
|
|
503
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
504
|
+
});
|
|
505
|
+
this.initialize();
|
|
506
|
+
return this.innerApiCalls.createInstanceConfig(request, options, callback);
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Check the status of the long running operation returned by `createInstanceConfig()`.
|
|
510
|
+
* @param {String} name
|
|
511
|
+
* The operation name that will be passed.
|
|
512
|
+
* @returns {Promise} - The promise which resolves to an object.
|
|
513
|
+
* The decoded operation object has result and metadata field to get information from.
|
|
514
|
+
* Please see the
|
|
515
|
+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
516
|
+
* for more details and examples.
|
|
517
|
+
* @example <caption>include:samples/generated/v1/instance_admin.create_instance_config.js</caption>
|
|
518
|
+
* region_tag:spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_async
|
|
519
|
+
*/
|
|
520
|
+
async checkCreateInstanceConfigProgress(name) {
|
|
521
|
+
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
522
|
+
const [operation] = await this.operationsClient.getOperation(request);
|
|
523
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstanceConfig, this._gaxModule.createDefaultBackoffSettings());
|
|
524
|
+
return decodeOperation;
|
|
525
|
+
}
|
|
526
|
+
updateInstanceConfig(request, optionsOrCallback, callback) {
|
|
527
|
+
var _a;
|
|
528
|
+
request = request || {};
|
|
529
|
+
let options;
|
|
530
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
531
|
+
callback = optionsOrCallback;
|
|
532
|
+
options = {};
|
|
533
|
+
}
|
|
534
|
+
else {
|
|
535
|
+
options = optionsOrCallback;
|
|
536
|
+
}
|
|
537
|
+
options = options || {};
|
|
538
|
+
options.otherArgs = options.otherArgs || {};
|
|
539
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
540
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
541
|
+
this._gaxModule.routingHeader.fromParams({
|
|
542
|
+
'instance_config.name': (_a = request.instanceConfig.name) !== null && _a !== void 0 ? _a : '',
|
|
543
|
+
});
|
|
544
|
+
this.initialize();
|
|
545
|
+
return this.innerApiCalls.updateInstanceConfig(request, options, callback);
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Check the status of the long running operation returned by `updateInstanceConfig()`.
|
|
549
|
+
* @param {String} name
|
|
550
|
+
* The operation name that will be passed.
|
|
551
|
+
* @returns {Promise} - The promise which resolves to an object.
|
|
552
|
+
* The decoded operation object has result and metadata field to get information from.
|
|
553
|
+
* Please see the
|
|
554
|
+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
555
|
+
* for more details and examples.
|
|
556
|
+
* @example <caption>include:samples/generated/v1/instance_admin.update_instance_config.js</caption>
|
|
557
|
+
* region_tag:spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_async
|
|
558
|
+
*/
|
|
559
|
+
async checkUpdateInstanceConfigProgress(name) {
|
|
560
|
+
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
561
|
+
const [operation] = await this.operationsClient.getOperation(request);
|
|
562
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstanceConfig, this._gaxModule.createDefaultBackoffSettings());
|
|
563
|
+
return decodeOperation;
|
|
564
|
+
}
|
|
441
565
|
createInstance(request, optionsOrCallback, callback) {
|
|
566
|
+
var _a;
|
|
442
567
|
request = request || {};
|
|
443
568
|
let options;
|
|
444
569
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -452,8 +577,8 @@ class InstanceAdminClient {
|
|
|
452
577
|
options.otherArgs = options.otherArgs || {};
|
|
453
578
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
454
579
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
455
|
-
|
|
456
|
-
parent: request.parent
|
|
580
|
+
this._gaxModule.routingHeader.fromParams({
|
|
581
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
457
582
|
});
|
|
458
583
|
this.initialize();
|
|
459
584
|
return this.innerApiCalls.createInstance(request, options, callback);
|
|
@@ -471,12 +596,13 @@ class InstanceAdminClient {
|
|
|
471
596
|
* region_tag:spanner_v1_generated_InstanceAdmin_CreateInstance_async
|
|
472
597
|
*/
|
|
473
598
|
async checkCreateInstanceProgress(name) {
|
|
474
|
-
const request = new
|
|
599
|
+
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
475
600
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
476
|
-
const decodeOperation = new
|
|
601
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings());
|
|
477
602
|
return decodeOperation;
|
|
478
603
|
}
|
|
479
604
|
updateInstance(request, optionsOrCallback, callback) {
|
|
605
|
+
var _a;
|
|
480
606
|
request = request || {};
|
|
481
607
|
let options;
|
|
482
608
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -490,8 +616,8 @@ class InstanceAdminClient {
|
|
|
490
616
|
options.otherArgs = options.otherArgs || {};
|
|
491
617
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
492
618
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
493
|
-
|
|
494
|
-
'instance.name': request.instance.name
|
|
619
|
+
this._gaxModule.routingHeader.fromParams({
|
|
620
|
+
'instance.name': (_a = request.instance.name) !== null && _a !== void 0 ? _a : '',
|
|
495
621
|
});
|
|
496
622
|
this.initialize();
|
|
497
623
|
return this.innerApiCalls.updateInstance(request, options, callback);
|
|
@@ -509,12 +635,13 @@ class InstanceAdminClient {
|
|
|
509
635
|
* region_tag:spanner_v1_generated_InstanceAdmin_UpdateInstance_async
|
|
510
636
|
*/
|
|
511
637
|
async checkUpdateInstanceProgress(name) {
|
|
512
|
-
const request = new
|
|
638
|
+
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
513
639
|
const [operation] = await this.operationsClient.getOperation(request);
|
|
514
|
-
const decodeOperation = new
|
|
640
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings());
|
|
515
641
|
return decodeOperation;
|
|
516
642
|
}
|
|
517
643
|
listInstanceConfigs(request, optionsOrCallback, callback) {
|
|
644
|
+
var _a;
|
|
518
645
|
request = request || {};
|
|
519
646
|
let options;
|
|
520
647
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -528,8 +655,8 @@ class InstanceAdminClient {
|
|
|
528
655
|
options.otherArgs = options.otherArgs || {};
|
|
529
656
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
530
657
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
531
|
-
|
|
532
|
-
parent: request.parent
|
|
658
|
+
this._gaxModule.routingHeader.fromParams({
|
|
659
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
533
660
|
});
|
|
534
661
|
this.initialize();
|
|
535
662
|
return this.innerApiCalls.listInstanceConfigs(request, options, callback);
|
|
@@ -548,7 +675,8 @@ class InstanceAdminClient {
|
|
|
548
675
|
* @param {string} request.pageToken
|
|
549
676
|
* If non-empty, `page_token` should contain a
|
|
550
677
|
* {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token}
|
|
551
|
-
* from a previous
|
|
678
|
+
* from a previous
|
|
679
|
+
* {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}.
|
|
552
680
|
* @param {object} [options]
|
|
553
681
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
554
682
|
* @returns {Stream}
|
|
@@ -562,13 +690,14 @@ class InstanceAdminClient {
|
|
|
562
690
|
* for more details and examples.
|
|
563
691
|
*/
|
|
564
692
|
listInstanceConfigsStream(request, options) {
|
|
693
|
+
var _a;
|
|
565
694
|
request = request || {};
|
|
566
695
|
options = options || {};
|
|
567
696
|
options.otherArgs = options.otherArgs || {};
|
|
568
697
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
569
698
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
570
|
-
|
|
571
|
-
parent: request.parent
|
|
699
|
+
this._gaxModule.routingHeader.fromParams({
|
|
700
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
572
701
|
});
|
|
573
702
|
const defaultCallSettings = this._defaults['listInstanceConfigs'];
|
|
574
703
|
const callSettings = defaultCallSettings.merge(options);
|
|
@@ -591,7 +720,8 @@ class InstanceAdminClient {
|
|
|
591
720
|
* @param {string} request.pageToken
|
|
592
721
|
* If non-empty, `page_token` should contain a
|
|
593
722
|
* {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse.next_page_token|next_page_token}
|
|
594
|
-
* from a previous
|
|
723
|
+
* from a previous
|
|
724
|
+
* {@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse|ListInstanceConfigsResponse}.
|
|
595
725
|
* @param {object} [options]
|
|
596
726
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
597
727
|
* @returns {Object}
|
|
@@ -606,20 +736,220 @@ class InstanceAdminClient {
|
|
|
606
736
|
* region_tag:spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_async
|
|
607
737
|
*/
|
|
608
738
|
listInstanceConfigsAsync(request, options) {
|
|
739
|
+
var _a;
|
|
609
740
|
request = request || {};
|
|
610
741
|
options = options || {};
|
|
611
742
|
options.otherArgs = options.otherArgs || {};
|
|
612
743
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
613
744
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
614
|
-
|
|
615
|
-
parent: request.parent
|
|
745
|
+
this._gaxModule.routingHeader.fromParams({
|
|
746
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
616
747
|
});
|
|
617
748
|
const defaultCallSettings = this._defaults['listInstanceConfigs'];
|
|
618
749
|
const callSettings = defaultCallSettings.merge(options);
|
|
619
750
|
this.initialize();
|
|
620
751
|
return this.descriptors.page.listInstanceConfigs.asyncIterate(this.innerApiCalls['listInstanceConfigs'], request, callSettings);
|
|
621
752
|
}
|
|
753
|
+
listInstanceConfigOperations(request, optionsOrCallback, callback) {
|
|
754
|
+
var _a;
|
|
755
|
+
request = request || {};
|
|
756
|
+
let options;
|
|
757
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
758
|
+
callback = optionsOrCallback;
|
|
759
|
+
options = {};
|
|
760
|
+
}
|
|
761
|
+
else {
|
|
762
|
+
options = optionsOrCallback;
|
|
763
|
+
}
|
|
764
|
+
options = options || {};
|
|
765
|
+
options.otherArgs = options.otherArgs || {};
|
|
766
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
767
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
768
|
+
this._gaxModule.routingHeader.fromParams({
|
|
769
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
770
|
+
});
|
|
771
|
+
this.initialize();
|
|
772
|
+
return this.innerApiCalls.listInstanceConfigOperations(request, options, callback);
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
|
|
776
|
+
* @param {Object} request
|
|
777
|
+
* The request object that will be sent.
|
|
778
|
+
* @param {string} request.parent
|
|
779
|
+
* Required. The project of the instance config operations.
|
|
780
|
+
* Values are of the form `projects/<project>`.
|
|
781
|
+
* @param {string} request.filter
|
|
782
|
+
* An expression that filters the list of returned operations.
|
|
783
|
+
*
|
|
784
|
+
* A filter expression consists of a field name, a
|
|
785
|
+
* comparison operator, and a value for filtering.
|
|
786
|
+
* The value must be a string, a number, or a boolean. The comparison operator
|
|
787
|
+
* must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
|
|
788
|
+
* Colon `:` is the contains operator. Filter rules are not case sensitive.
|
|
789
|
+
*
|
|
790
|
+
* The following fields in the {@link google.longrunning.Operation|Operation}
|
|
791
|
+
* are eligible for filtering:
|
|
792
|
+
*
|
|
793
|
+
* * `name` - The name of the long-running operation
|
|
794
|
+
* * `done` - False if the operation is in progress, else true.
|
|
795
|
+
* * `metadata.@type` - the type of metadata. For example, the type string
|
|
796
|
+
* for
|
|
797
|
+
* {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}
|
|
798
|
+
* is
|
|
799
|
+
* `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`.
|
|
800
|
+
* * `metadata.<field_name>` - any field in metadata.value.
|
|
801
|
+
* `metadata.@type` must be specified first, if filtering on metadata
|
|
802
|
+
* fields.
|
|
803
|
+
* * `error` - Error associated with the long-running operation.
|
|
804
|
+
* * `response.@type` - the type of response.
|
|
805
|
+
* * `response.<field_name>` - any field in response.value.
|
|
806
|
+
*
|
|
807
|
+
* You can combine multiple expressions by enclosing each expression in
|
|
808
|
+
* parentheses. By default, expressions are combined with AND logic. However,
|
|
809
|
+
* you can specify AND, OR, and NOT logic explicitly.
|
|
810
|
+
*
|
|
811
|
+
* Here are a few examples:
|
|
812
|
+
*
|
|
813
|
+
* * `done:true` - The operation is complete.
|
|
814
|
+
* * `(metadata.@type=` \
|
|
815
|
+
* `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata)
|
|
816
|
+
* AND` \
|
|
817
|
+
* `(metadata.instance_config.name:custom-config) AND` \
|
|
818
|
+
* `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \
|
|
819
|
+
* `(error:*)` - Return operations where:
|
|
820
|
+
* * The operation's metadata type is
|
|
821
|
+
* {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}.
|
|
822
|
+
* * The instance config name contains "custom-config".
|
|
823
|
+
* * The operation started before 2021-03-28T14:50:00Z.
|
|
824
|
+
* * The operation resulted in an error.
|
|
825
|
+
* @param {number} request.pageSize
|
|
826
|
+
* Number of operations to be returned in the response. If 0 or
|
|
827
|
+
* less, defaults to the server's maximum allowed page size.
|
|
828
|
+
* @param {string} request.pageToken
|
|
829
|
+
* If non-empty, `page_token` should contain a
|
|
830
|
+
* {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token}
|
|
831
|
+
* from a previous
|
|
832
|
+
* {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse}
|
|
833
|
+
* to the same `parent` and with the same `filter`.
|
|
834
|
+
* @param {object} [options]
|
|
835
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
836
|
+
* @returns {Stream}
|
|
837
|
+
* An object stream which emits an object representing [Operation]{@link google.longrunning.Operation} on 'data' event.
|
|
838
|
+
* The client library will perform auto-pagination by default: it will call the API as many
|
|
839
|
+
* times as needed. Note that it can affect your quota.
|
|
840
|
+
* We recommend using `listInstanceConfigOperationsAsync()`
|
|
841
|
+
* method described below for async iteration which you can stop as needed.
|
|
842
|
+
* Please see the
|
|
843
|
+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
844
|
+
* for more details and examples.
|
|
845
|
+
*/
|
|
846
|
+
listInstanceConfigOperationsStream(request, options) {
|
|
847
|
+
var _a;
|
|
848
|
+
request = request || {};
|
|
849
|
+
options = options || {};
|
|
850
|
+
options.otherArgs = options.otherArgs || {};
|
|
851
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
852
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
853
|
+
this._gaxModule.routingHeader.fromParams({
|
|
854
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
855
|
+
});
|
|
856
|
+
const defaultCallSettings = this._defaults['listInstanceConfigOperations'];
|
|
857
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
858
|
+
this.initialize();
|
|
859
|
+
return this.descriptors.page.listInstanceConfigOperations.createStream(this.innerApiCalls.listInstanceConfigOperations, request, callSettings);
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Equivalent to `listInstanceConfigOperations`, but returns an iterable object.
|
|
863
|
+
*
|
|
864
|
+
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
|
865
|
+
* @param {Object} request
|
|
866
|
+
* The request object that will be sent.
|
|
867
|
+
* @param {string} request.parent
|
|
868
|
+
* Required. The project of the instance config operations.
|
|
869
|
+
* Values are of the form `projects/<project>`.
|
|
870
|
+
* @param {string} request.filter
|
|
871
|
+
* An expression that filters the list of returned operations.
|
|
872
|
+
*
|
|
873
|
+
* A filter expression consists of a field name, a
|
|
874
|
+
* comparison operator, and a value for filtering.
|
|
875
|
+
* The value must be a string, a number, or a boolean. The comparison operator
|
|
876
|
+
* must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
|
|
877
|
+
* Colon `:` is the contains operator. Filter rules are not case sensitive.
|
|
878
|
+
*
|
|
879
|
+
* The following fields in the {@link google.longrunning.Operation|Operation}
|
|
880
|
+
* are eligible for filtering:
|
|
881
|
+
*
|
|
882
|
+
* * `name` - The name of the long-running operation
|
|
883
|
+
* * `done` - False if the operation is in progress, else true.
|
|
884
|
+
* * `metadata.@type` - the type of metadata. For example, the type string
|
|
885
|
+
* for
|
|
886
|
+
* {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}
|
|
887
|
+
* is
|
|
888
|
+
* `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`.
|
|
889
|
+
* * `metadata.<field_name>` - any field in metadata.value.
|
|
890
|
+
* `metadata.@type` must be specified first, if filtering on metadata
|
|
891
|
+
* fields.
|
|
892
|
+
* * `error` - Error associated with the long-running operation.
|
|
893
|
+
* * `response.@type` - the type of response.
|
|
894
|
+
* * `response.<field_name>` - any field in response.value.
|
|
895
|
+
*
|
|
896
|
+
* You can combine multiple expressions by enclosing each expression in
|
|
897
|
+
* parentheses. By default, expressions are combined with AND logic. However,
|
|
898
|
+
* you can specify AND, OR, and NOT logic explicitly.
|
|
899
|
+
*
|
|
900
|
+
* Here are a few examples:
|
|
901
|
+
*
|
|
902
|
+
* * `done:true` - The operation is complete.
|
|
903
|
+
* * `(metadata.@type=` \
|
|
904
|
+
* `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata)
|
|
905
|
+
* AND` \
|
|
906
|
+
* `(metadata.instance_config.name:custom-config) AND` \
|
|
907
|
+
* `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \
|
|
908
|
+
* `(error:*)` - Return operations where:
|
|
909
|
+
* * The operation's metadata type is
|
|
910
|
+
* {@link google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}.
|
|
911
|
+
* * The instance config name contains "custom-config".
|
|
912
|
+
* * The operation started before 2021-03-28T14:50:00Z.
|
|
913
|
+
* * The operation resulted in an error.
|
|
914
|
+
* @param {number} request.pageSize
|
|
915
|
+
* Number of operations to be returned in the response. If 0 or
|
|
916
|
+
* less, defaults to the server's maximum allowed page size.
|
|
917
|
+
* @param {string} request.pageToken
|
|
918
|
+
* If non-empty, `page_token` should contain a
|
|
919
|
+
* {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.next_page_token|next_page_token}
|
|
920
|
+
* from a previous
|
|
921
|
+
* {@link google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse|ListInstanceConfigOperationsResponse}
|
|
922
|
+
* to the same `parent` and with the same `filter`.
|
|
923
|
+
* @param {object} [options]
|
|
924
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
925
|
+
* @returns {Object}
|
|
926
|
+
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
|
|
927
|
+
* When you iterate the returned iterable, each element will be an object representing
|
|
928
|
+
* [Operation]{@link google.longrunning.Operation}. The API will be called under the hood as needed, once per the page,
|
|
929
|
+
* so you can stop the iteration when you don't need more results.
|
|
930
|
+
* Please see the
|
|
931
|
+
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
932
|
+
* for more details and examples.
|
|
933
|
+
* @example <caption>include:samples/generated/v1/instance_admin.list_instance_config_operations.js</caption>
|
|
934
|
+
* region_tag:spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_async
|
|
935
|
+
*/
|
|
936
|
+
listInstanceConfigOperationsAsync(request, options) {
|
|
937
|
+
var _a;
|
|
938
|
+
request = request || {};
|
|
939
|
+
options = options || {};
|
|
940
|
+
options.otherArgs = options.otherArgs || {};
|
|
941
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
942
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
943
|
+
this._gaxModule.routingHeader.fromParams({
|
|
944
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
945
|
+
});
|
|
946
|
+
const defaultCallSettings = this._defaults['listInstanceConfigOperations'];
|
|
947
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
948
|
+
this.initialize();
|
|
949
|
+
return this.descriptors.page.listInstanceConfigOperations.asyncIterate(this.innerApiCalls['listInstanceConfigOperations'], request, callSettings);
|
|
950
|
+
}
|
|
622
951
|
listInstances(request, optionsOrCallback, callback) {
|
|
952
|
+
var _a;
|
|
623
953
|
request = request || {};
|
|
624
954
|
let options;
|
|
625
955
|
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
@@ -633,8 +963,8 @@ class InstanceAdminClient {
|
|
|
633
963
|
options.otherArgs = options.otherArgs || {};
|
|
634
964
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
635
965
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
636
|
-
|
|
637
|
-
parent: request.parent
|
|
966
|
+
this._gaxModule.routingHeader.fromParams({
|
|
967
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
638
968
|
});
|
|
639
969
|
this.initialize();
|
|
640
970
|
return this.innerApiCalls.listInstances(request, options, callback);
|
|
@@ -651,8 +981,9 @@ class InstanceAdminClient {
|
|
|
651
981
|
* to the server's maximum allowed page size.
|
|
652
982
|
* @param {string} request.pageToken
|
|
653
983
|
* If non-empty, `page_token` should contain a
|
|
654
|
-
* {@link google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token}
|
|
655
|
-
*
|
|
984
|
+
* {@link google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token}
|
|
985
|
+
* from a previous
|
|
986
|
+
* {@link google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}.
|
|
656
987
|
* @param {string} request.filter
|
|
657
988
|
* An expression for filtering the results of the request. Filter rules are
|
|
658
989
|
* case insensitive. The fields eligible for filtering are:
|
|
@@ -686,13 +1017,14 @@ class InstanceAdminClient {
|
|
|
686
1017
|
* for more details and examples.
|
|
687
1018
|
*/
|
|
688
1019
|
listInstancesStream(request, options) {
|
|
1020
|
+
var _a;
|
|
689
1021
|
request = request || {};
|
|
690
1022
|
options = options || {};
|
|
691
1023
|
options.otherArgs = options.otherArgs || {};
|
|
692
1024
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
693
1025
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
694
|
-
|
|
695
|
-
parent: request.parent
|
|
1026
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1027
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
696
1028
|
});
|
|
697
1029
|
const defaultCallSettings = this._defaults['listInstances'];
|
|
698
1030
|
const callSettings = defaultCallSettings.merge(options);
|
|
@@ -713,8 +1045,9 @@ class InstanceAdminClient {
|
|
|
713
1045
|
* to the server's maximum allowed page size.
|
|
714
1046
|
* @param {string} request.pageToken
|
|
715
1047
|
* If non-empty, `page_token` should contain a
|
|
716
|
-
* {@link google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token}
|
|
717
|
-
*
|
|
1048
|
+
* {@link google.spanner.admin.instance.v1.ListInstancesResponse.next_page_token|next_page_token}
|
|
1049
|
+
* from a previous
|
|
1050
|
+
* {@link google.spanner.admin.instance.v1.ListInstancesResponse|ListInstancesResponse}.
|
|
718
1051
|
* @param {string} request.filter
|
|
719
1052
|
* An expression for filtering the results of the request. Filter rules are
|
|
720
1053
|
* case insensitive. The fields eligible for filtering are:
|
|
@@ -749,13 +1082,14 @@ class InstanceAdminClient {
|
|
|
749
1082
|
* region_tag:spanner_v1_generated_InstanceAdmin_ListInstances_async
|
|
750
1083
|
*/
|
|
751
1084
|
listInstancesAsync(request, options) {
|
|
1085
|
+
var _a;
|
|
752
1086
|
request = request || {};
|
|
753
1087
|
options = options || {};
|
|
754
1088
|
options.otherArgs = options.otherArgs || {};
|
|
755
1089
|
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
756
1090
|
options.otherArgs.headers['x-goog-request-params'] =
|
|
757
|
-
|
|
758
|
-
parent: request.parent
|
|
1091
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1092
|
+
parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
|
|
759
1093
|
});
|
|
760
1094
|
const defaultCallSettings = this._defaults['listInstances'];
|
|
761
1095
|
const callSettings = defaultCallSettings.merge(options);
|