@google-cloud/spanner 5.14.0 → 5.16.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 +34 -0
- package/README.md +55 -52
- package/build/protos/protos.d.ts +2 -1
- package/build/protos/protos.js +7 -0
- package/build/protos/protos.json +14 -1
- package/build/src/backup.d.ts +214 -0
- package/build/src/backup.js +4 -196
- package/build/src/batch-transaction.d.ts +6 -0
- package/build/src/batch-transaction.js +6 -0
- package/build/src/codec.d.ts +5 -0
- package/build/src/codec.js +16 -0
- package/build/src/database.d.ts +1244 -22
- package/build/src/database.js +36 -1184
- package/build/src/index.d.ts +366 -17
- package/build/src/index.js +39 -312
- package/build/src/instance.d.ts +526 -0
- package/build/src/instance.js +18 -498
- package/build/src/session-pool.d.ts +5 -5
- package/build/src/session-pool.js +13 -8
- package/build/src/session.d.ts +98 -0
- package/build/src/session.js +16 -82
- package/build/src/table.d.ts +645 -0
- package/build/src/table.js +4 -623
- package/build/src/transaction.d.ts +529 -19
- package/build/src/transaction.js +131 -443
- package/build/src/v1/database_admin_client.d.ts +666 -40
- package/build/src/v1/database_admin_client.js +32 -706
- package/build/src/v1/gapic_metadata.json +1 -1
- package/build/src/v1/instance_admin_client.d.ts +357 -20
- package/build/src/v1/instance_admin_client.js +16 -377
- package/build/src/v1/spanner_client.d.ts +586 -13
- package/build/src/v1/spanner_client.js +10 -596
- package/package.json +3 -3
|
@@ -286,24 +286,6 @@ class DatabaseAdminClient {
|
|
|
286
286
|
}
|
|
287
287
|
return this.auth.getProjectId();
|
|
288
288
|
}
|
|
289
|
-
/**
|
|
290
|
-
* Gets the state of a Cloud Spanner database.
|
|
291
|
-
*
|
|
292
|
-
* @param {Object} request
|
|
293
|
-
* The request object that will be sent.
|
|
294
|
-
* @param {string} request.name
|
|
295
|
-
* Required. The name of the requested database. Values are of the form
|
|
296
|
-
* `projects/<project>/instances/<instance>/databases/<database>`.
|
|
297
|
-
* @param {object} [options]
|
|
298
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
299
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
300
|
-
* The first element of the array is an object representing [Database]{@link google.spanner.admin.database.v1.Database}.
|
|
301
|
-
* Please see the
|
|
302
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
303
|
-
* for more details and examples.
|
|
304
|
-
* @example
|
|
305
|
-
* const [response] = await client.getDatabase(request);
|
|
306
|
-
*/
|
|
307
289
|
getDatabase(request, optionsOrCallback, callback) {
|
|
308
290
|
request = request || {};
|
|
309
291
|
let options;
|
|
@@ -324,25 +306,6 @@ class DatabaseAdminClient {
|
|
|
324
306
|
this.initialize();
|
|
325
307
|
return this.innerApiCalls.getDatabase(request, options, callback);
|
|
326
308
|
}
|
|
327
|
-
/**
|
|
328
|
-
* Drops (aka deletes) a Cloud Spanner database.
|
|
329
|
-
* Completed backups for the database will be retained according to their
|
|
330
|
-
* `expire_time`.
|
|
331
|
-
*
|
|
332
|
-
* @param {Object} request
|
|
333
|
-
* The request object that will be sent.
|
|
334
|
-
* @param {string} request.database
|
|
335
|
-
* Required. The database to be dropped.
|
|
336
|
-
* @param {object} [options]
|
|
337
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
338
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
339
|
-
* The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
|
|
340
|
-
* Please see the
|
|
341
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
342
|
-
* for more details and examples.
|
|
343
|
-
* @example
|
|
344
|
-
* const [response] = await client.dropDatabase(request);
|
|
345
|
-
*/
|
|
346
309
|
dropDatabase(request, optionsOrCallback, callback) {
|
|
347
310
|
request = request || {};
|
|
348
311
|
let options;
|
|
@@ -363,27 +326,6 @@ class DatabaseAdminClient {
|
|
|
363
326
|
this.initialize();
|
|
364
327
|
return this.innerApiCalls.dropDatabase(request, options, callback);
|
|
365
328
|
}
|
|
366
|
-
/**
|
|
367
|
-
* Returns the schema of a Cloud Spanner database as a list of formatted
|
|
368
|
-
* DDL statements. This method does not show pending schema updates, those may
|
|
369
|
-
* be queried using the {@link google.longrunning.Operations|Operations} API.
|
|
370
|
-
*
|
|
371
|
-
* @param {Object} request
|
|
372
|
-
* The request object that will be sent.
|
|
373
|
-
* @param {string} request.database
|
|
374
|
-
* Required. The database whose schema we wish to get.
|
|
375
|
-
* Values are of the form
|
|
376
|
-
* `projects/<project>/instances/<instance>/databases/<database>`
|
|
377
|
-
* @param {object} [options]
|
|
378
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
379
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
380
|
-
* The first element of the array is an object representing [GetDatabaseDdlResponse]{@link google.spanner.admin.database.v1.GetDatabaseDdlResponse}.
|
|
381
|
-
* Please see the
|
|
382
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
383
|
-
* for more details and examples.
|
|
384
|
-
* @example
|
|
385
|
-
* const [response] = await client.getDatabaseDdl(request);
|
|
386
|
-
*/
|
|
387
329
|
getDatabaseDdl(request, optionsOrCallback, callback) {
|
|
388
330
|
request = request || {};
|
|
389
331
|
let options;
|
|
@@ -404,35 +346,6 @@ class DatabaseAdminClient {
|
|
|
404
346
|
this.initialize();
|
|
405
347
|
return this.innerApiCalls.getDatabaseDdl(request, options, callback);
|
|
406
348
|
}
|
|
407
|
-
/**
|
|
408
|
-
* Sets the access control policy on a database or backup resource.
|
|
409
|
-
* Replaces any existing policy.
|
|
410
|
-
*
|
|
411
|
-
* Authorization requires `spanner.databases.setIamPolicy`
|
|
412
|
-
* permission on {@link google.iam.v1.SetIamPolicyRequest.resource|resource}.
|
|
413
|
-
* For backups, authorization requires `spanner.backups.setIamPolicy`
|
|
414
|
-
* permission on {@link google.iam.v1.SetIamPolicyRequest.resource|resource}.
|
|
415
|
-
*
|
|
416
|
-
* @param {Object} request
|
|
417
|
-
* The request object that will be sent.
|
|
418
|
-
* @param {string} request.resource
|
|
419
|
-
* REQUIRED: The resource for which the policy is being specified.
|
|
420
|
-
* See the operation documentation for the appropriate value for this field.
|
|
421
|
-
* @param {google.iam.v1.Policy} request.policy
|
|
422
|
-
* REQUIRED: The complete policy to be applied to the `resource`. The size of
|
|
423
|
-
* the policy is limited to a few 10s of KB. An empty policy is a
|
|
424
|
-
* valid policy but certain Cloud Platform services (such as Projects)
|
|
425
|
-
* might reject them.
|
|
426
|
-
* @param {object} [options]
|
|
427
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
428
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
429
|
-
* The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
|
|
430
|
-
* Please see the
|
|
431
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
432
|
-
* for more details and examples.
|
|
433
|
-
* @example
|
|
434
|
-
* const [response] = await client.setIamPolicy(request);
|
|
435
|
-
*/
|
|
436
349
|
setIamPolicy(request, optionsOrCallback, callback) {
|
|
437
350
|
request = request || {};
|
|
438
351
|
let options;
|
|
@@ -453,34 +366,6 @@ class DatabaseAdminClient {
|
|
|
453
366
|
this.initialize();
|
|
454
367
|
return this.innerApiCalls.setIamPolicy(request, options, callback);
|
|
455
368
|
}
|
|
456
|
-
/**
|
|
457
|
-
* Gets the access control policy for a database or backup resource.
|
|
458
|
-
* Returns an empty policy if a database or backup exists but does not have a
|
|
459
|
-
* policy set.
|
|
460
|
-
*
|
|
461
|
-
* Authorization requires `spanner.databases.getIamPolicy` permission on
|
|
462
|
-
* {@link google.iam.v1.GetIamPolicyRequest.resource|resource}.
|
|
463
|
-
* For backups, authorization requires `spanner.backups.getIamPolicy`
|
|
464
|
-
* permission on {@link google.iam.v1.GetIamPolicyRequest.resource|resource}.
|
|
465
|
-
*
|
|
466
|
-
* @param {Object} request
|
|
467
|
-
* The request object that will be sent.
|
|
468
|
-
* @param {string} request.resource
|
|
469
|
-
* REQUIRED: The resource for which the policy is being requested.
|
|
470
|
-
* See the operation documentation for the appropriate value for this field.
|
|
471
|
-
* @param {google.iam.v1.GetPolicyOptions} request.options
|
|
472
|
-
* OPTIONAL: A `GetPolicyOptions` object for specifying options to
|
|
473
|
-
* `GetIamPolicy`. This field is only used by Cloud IAM.
|
|
474
|
-
* @param {object} [options]
|
|
475
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
476
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
477
|
-
* The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
|
|
478
|
-
* Please see the
|
|
479
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
480
|
-
* for more details and examples.
|
|
481
|
-
* @example
|
|
482
|
-
* const [response] = await client.getIamPolicy(request);
|
|
483
|
-
*/
|
|
484
369
|
getIamPolicy(request, optionsOrCallback, callback) {
|
|
485
370
|
request = request || {};
|
|
486
371
|
let options;
|
|
@@ -501,38 +386,6 @@ class DatabaseAdminClient {
|
|
|
501
386
|
this.initialize();
|
|
502
387
|
return this.innerApiCalls.getIamPolicy(request, options, callback);
|
|
503
388
|
}
|
|
504
|
-
/**
|
|
505
|
-
* Returns permissions that the caller has on the specified database or backup
|
|
506
|
-
* resource.
|
|
507
|
-
*
|
|
508
|
-
* Attempting this RPC on a non-existent Cloud Spanner database will
|
|
509
|
-
* result in a NOT_FOUND error if the user has
|
|
510
|
-
* `spanner.databases.list` permission on the containing Cloud
|
|
511
|
-
* Spanner instance. Otherwise returns an empty set of permissions.
|
|
512
|
-
* Calling this method on a backup that does not exist will
|
|
513
|
-
* result in a NOT_FOUND error if the user has
|
|
514
|
-
* `spanner.backups.list` permission on the containing instance.
|
|
515
|
-
*
|
|
516
|
-
* @param {Object} request
|
|
517
|
-
* The request object that will be sent.
|
|
518
|
-
* @param {string} request.resource
|
|
519
|
-
* REQUIRED: The resource for which the policy detail is being requested.
|
|
520
|
-
* See the operation documentation for the appropriate value for this field.
|
|
521
|
-
* @param {string[]} request.permissions
|
|
522
|
-
* The set of permissions to check for the `resource`. Permissions with
|
|
523
|
-
* wildcards (such as '*' or 'storage.*') are not allowed. For more
|
|
524
|
-
* information see
|
|
525
|
-
* [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
|
|
526
|
-
* @param {object} [options]
|
|
527
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
528
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
529
|
-
* The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
|
|
530
|
-
* Please see the
|
|
531
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
532
|
-
* for more details and examples.
|
|
533
|
-
* @example
|
|
534
|
-
* const [response] = await client.testIamPermissions(request);
|
|
535
|
-
*/
|
|
536
389
|
testIamPermissions(request, optionsOrCallback, callback) {
|
|
537
390
|
request = request || {};
|
|
538
391
|
let options;
|
|
@@ -553,25 +406,6 @@ class DatabaseAdminClient {
|
|
|
553
406
|
this.initialize();
|
|
554
407
|
return this.innerApiCalls.testIamPermissions(request, options, callback);
|
|
555
408
|
}
|
|
556
|
-
/**
|
|
557
|
-
* Gets metadata on a pending or completed {@link google.spanner.admin.database.v1.Backup|Backup}.
|
|
558
|
-
*
|
|
559
|
-
* @param {Object} request
|
|
560
|
-
* The request object that will be sent.
|
|
561
|
-
* @param {string} request.name
|
|
562
|
-
* Required. Name of the backup.
|
|
563
|
-
* Values are of the form
|
|
564
|
-
* `projects/<project>/instances/<instance>/backups/<backup>`.
|
|
565
|
-
* @param {object} [options]
|
|
566
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
567
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
568
|
-
* The first element of the array is an object representing [Backup]{@link google.spanner.admin.database.v1.Backup}.
|
|
569
|
-
* Please see the
|
|
570
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
571
|
-
* for more details and examples.
|
|
572
|
-
* @example
|
|
573
|
-
* const [response] = await client.getBackup(request);
|
|
574
|
-
*/
|
|
575
409
|
getBackup(request, optionsOrCallback, callback) {
|
|
576
410
|
request = request || {};
|
|
577
411
|
let options;
|
|
@@ -592,32 +426,6 @@ class DatabaseAdminClient {
|
|
|
592
426
|
this.initialize();
|
|
593
427
|
return this.innerApiCalls.getBackup(request, options, callback);
|
|
594
428
|
}
|
|
595
|
-
/**
|
|
596
|
-
* Updates a pending or completed {@link google.spanner.admin.database.v1.Backup|Backup}.
|
|
597
|
-
*
|
|
598
|
-
* @param {Object} request
|
|
599
|
-
* The request object that will be sent.
|
|
600
|
-
* @param {google.spanner.admin.database.v1.Backup} request.backup
|
|
601
|
-
* Required. The backup to update. `backup.name`, and the fields to be updated
|
|
602
|
-
* as specified by `update_mask` are required. Other fields are ignored.
|
|
603
|
-
* Update is only supported for the following fields:
|
|
604
|
-
* * `backup.expire_time`.
|
|
605
|
-
* @param {google.protobuf.FieldMask} request.updateMask
|
|
606
|
-
* Required. A mask specifying which fields (e.g. `expire_time`) in the
|
|
607
|
-
* Backup resource should be updated. This mask is relative to the Backup
|
|
608
|
-
* resource, not to the request message. The field mask must always be
|
|
609
|
-
* specified; this prevents any future fields from being erased accidentally
|
|
610
|
-
* by clients that do not know about them.
|
|
611
|
-
* @param {object} [options]
|
|
612
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
613
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
614
|
-
* The first element of the array is an object representing [Backup]{@link google.spanner.admin.database.v1.Backup}.
|
|
615
|
-
* Please see the
|
|
616
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
617
|
-
* for more details and examples.
|
|
618
|
-
* @example
|
|
619
|
-
* const [response] = await client.updateBackup(request);
|
|
620
|
-
*/
|
|
621
429
|
updateBackup(request, optionsOrCallback, callback) {
|
|
622
430
|
request = request || {};
|
|
623
431
|
let options;
|
|
@@ -638,25 +446,6 @@ class DatabaseAdminClient {
|
|
|
638
446
|
this.initialize();
|
|
639
447
|
return this.innerApiCalls.updateBackup(request, options, callback);
|
|
640
448
|
}
|
|
641
|
-
/**
|
|
642
|
-
* Deletes a pending or completed {@link google.spanner.admin.database.v1.Backup|Backup}.
|
|
643
|
-
*
|
|
644
|
-
* @param {Object} request
|
|
645
|
-
* The request object that will be sent.
|
|
646
|
-
* @param {string} request.name
|
|
647
|
-
* Required. Name of the backup to delete.
|
|
648
|
-
* Values are of the form
|
|
649
|
-
* `projects/<project>/instances/<instance>/backups/<backup>`.
|
|
650
|
-
* @param {object} [options]
|
|
651
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
652
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
653
|
-
* The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
|
|
654
|
-
* Please see the
|
|
655
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
|
656
|
-
* for more details and examples.
|
|
657
|
-
* @example
|
|
658
|
-
* const [response] = await client.deleteBackup(request);
|
|
659
|
-
*/
|
|
660
449
|
deleteBackup(request, optionsOrCallback, callback) {
|
|
661
450
|
request = request || {};
|
|
662
451
|
let options;
|
|
@@ -677,49 +466,6 @@ class DatabaseAdminClient {
|
|
|
677
466
|
this.initialize();
|
|
678
467
|
return this.innerApiCalls.deleteBackup(request, options, callback);
|
|
679
468
|
}
|
|
680
|
-
/**
|
|
681
|
-
* Creates a new Cloud Spanner database and starts to prepare it for serving.
|
|
682
|
-
* The returned {@link google.longrunning.Operation|long-running operation} will
|
|
683
|
-
* have a name of the format `<database_name>/operations/<operation_id>` and
|
|
684
|
-
* can be used to track preparation of the database. The
|
|
685
|
-
* {@link google.longrunning.Operation.metadata|metadata} field type is
|
|
686
|
-
* {@link google.spanner.admin.database.v1.CreateDatabaseMetadata|CreateDatabaseMetadata}. The
|
|
687
|
-
* {@link google.longrunning.Operation.response|response} field type is
|
|
688
|
-
* {@link google.spanner.admin.database.v1.Database|Database}, if successful.
|
|
689
|
-
*
|
|
690
|
-
* @param {Object} request
|
|
691
|
-
* The request object that will be sent.
|
|
692
|
-
* @param {string} request.parent
|
|
693
|
-
* Required. The name of the instance that will serve the new database.
|
|
694
|
-
* Values are of the form `projects/<project>/instances/<instance>`.
|
|
695
|
-
* @param {string} request.createStatement
|
|
696
|
-
* Required. A `CREATE DATABASE` statement, which specifies the ID of the
|
|
697
|
-
* new database. The database ID must conform to the regular expression
|
|
698
|
-
* `{@link a-z0-9_\-|a-z}*[a-z0-9]` and be between 2 and 30 characters in length.
|
|
699
|
-
* If the database ID is a reserved word or if it contains a hyphen, the
|
|
700
|
-
* database ID must be enclosed in backticks (`` ` ``).
|
|
701
|
-
* @param {string[]} [request.extraStatements]
|
|
702
|
-
* Optional. A list of DDL statements to run inside the newly created
|
|
703
|
-
* database. Statements can create tables, indexes, etc. These
|
|
704
|
-
* statements execute atomically with the creation of the database:
|
|
705
|
-
* if there is an error in any statement, the database is not created.
|
|
706
|
-
* @param {google.spanner.admin.database.v1.EncryptionConfig} [request.encryptionConfig]
|
|
707
|
-
* Optional. The encryption configuration for the database. If this field is not
|
|
708
|
-
* specified, Cloud Spanner will encrypt/decrypt all data at rest using
|
|
709
|
-
* Google default encryption.
|
|
710
|
-
* @param {object} [options]
|
|
711
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
712
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
713
|
-
* The first element of the array is an object representing
|
|
714
|
-
* a long running operation. Its `promise()` method returns a promise
|
|
715
|
-
* you can `await` for.
|
|
716
|
-
* Please see the
|
|
717
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
718
|
-
* for more details and examples.
|
|
719
|
-
* @example
|
|
720
|
-
* const [operation] = await client.createDatabase(request);
|
|
721
|
-
* const [response] = await operation.promise();
|
|
722
|
-
*/
|
|
723
469
|
createDatabase(request, optionsOrCallback, callback) {
|
|
724
470
|
request = request || {};
|
|
725
471
|
let options;
|
|
@@ -749,11 +495,8 @@ class DatabaseAdminClient {
|
|
|
749
495
|
* Please see the
|
|
750
496
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
751
497
|
* for more details and examples.
|
|
752
|
-
* @example
|
|
753
|
-
*
|
|
754
|
-
* console.log(decodedOperation.result);
|
|
755
|
-
* console.log(decodedOperation.done);
|
|
756
|
-
* console.log(decodedOperation.metadata);
|
|
498
|
+
* @example <caption>include:samples/generated/v1/database_admin.create_database.js</caption>
|
|
499
|
+
* region_tag:spanner_v1_generated_DatabaseAdmin_CreateDatabase_async
|
|
757
500
|
*/
|
|
758
501
|
async checkCreateDatabaseProgress(name) {
|
|
759
502
|
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
@@ -761,54 +504,6 @@ class DatabaseAdminClient {
|
|
|
761
504
|
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createDatabase, gax.createDefaultBackoffSettings());
|
|
762
505
|
return decodeOperation;
|
|
763
506
|
}
|
|
764
|
-
/**
|
|
765
|
-
* Updates the schema of a Cloud Spanner database by
|
|
766
|
-
* creating/altering/dropping tables, columns, indexes, etc. The returned
|
|
767
|
-
* {@link google.longrunning.Operation|long-running operation} will have a name of
|
|
768
|
-
* the format `<database_name>/operations/<operation_id>` and can be used to
|
|
769
|
-
* track execution of the schema change(s). The
|
|
770
|
-
* {@link google.longrunning.Operation.metadata|metadata} field type is
|
|
771
|
-
* {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata|UpdateDatabaseDdlMetadata}. The operation has no response.
|
|
772
|
-
*
|
|
773
|
-
* @param {Object} request
|
|
774
|
-
* The request object that will be sent.
|
|
775
|
-
* @param {string} request.database
|
|
776
|
-
* Required. The database to update.
|
|
777
|
-
* @param {string[]} request.statements
|
|
778
|
-
* Required. DDL statements to be applied to the database.
|
|
779
|
-
* @param {string} request.operationId
|
|
780
|
-
* If empty, the new update request is assigned an
|
|
781
|
-
* automatically-generated operation ID. Otherwise, `operation_id`
|
|
782
|
-
* is used to construct the name of the resulting
|
|
783
|
-
* {@link google.longrunning.Operation|Operation}.
|
|
784
|
-
*
|
|
785
|
-
* Specifying an explicit operation ID simplifies determining
|
|
786
|
-
* whether the statements were executed in the event that the
|
|
787
|
-
* {@link google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} call is replayed,
|
|
788
|
-
* or the return value is otherwise lost: the {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database|database} and
|
|
789
|
-
* `operation_id` fields can be combined to form the
|
|
790
|
-
* {@link google.longrunning.Operation.name|name} of the resulting
|
|
791
|
-
* {@link google.longrunning.Operation|longrunning.Operation}: `<database>/operations/<operation_id>`.
|
|
792
|
-
*
|
|
793
|
-
* `operation_id` should be unique within the database, and must be
|
|
794
|
-
* a valid identifier: `{@link a-z0-9_|a-z}*`. Note that
|
|
795
|
-
* automatically-generated operation IDs always begin with an
|
|
796
|
-
* underscore. If the named operation already exists,
|
|
797
|
-
* {@link google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} returns
|
|
798
|
-
* `ALREADY_EXISTS`.
|
|
799
|
-
* @param {object} [options]
|
|
800
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
801
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
802
|
-
* The first element of the array is an object representing
|
|
803
|
-
* a long running operation. Its `promise()` method returns a promise
|
|
804
|
-
* you can `await` for.
|
|
805
|
-
* Please see the
|
|
806
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
807
|
-
* for more details and examples.
|
|
808
|
-
* @example
|
|
809
|
-
* const [operation] = await client.updateDatabaseDdl(request);
|
|
810
|
-
* const [response] = await operation.promise();
|
|
811
|
-
*/
|
|
812
507
|
updateDatabaseDdl(request, optionsOrCallback, callback) {
|
|
813
508
|
request = request || {};
|
|
814
509
|
let options;
|
|
@@ -838,11 +533,8 @@ class DatabaseAdminClient {
|
|
|
838
533
|
* Please see the
|
|
839
534
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
840
535
|
* for more details and examples.
|
|
841
|
-
* @example
|
|
842
|
-
*
|
|
843
|
-
* console.log(decodedOperation.result);
|
|
844
|
-
* console.log(decodedOperation.done);
|
|
845
|
-
* console.log(decodedOperation.metadata);
|
|
536
|
+
* @example <caption>include:samples/generated/v1/database_admin.update_database_ddl.js</caption>
|
|
537
|
+
* region_tag:spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_async
|
|
846
538
|
*/
|
|
847
539
|
async checkUpdateDatabaseDdlProgress(name) {
|
|
848
540
|
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
@@ -850,54 +542,6 @@ class DatabaseAdminClient {
|
|
|
850
542
|
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateDatabaseDdl, gax.createDefaultBackoffSettings());
|
|
851
543
|
return decodeOperation;
|
|
852
544
|
}
|
|
853
|
-
/**
|
|
854
|
-
* Starts creating a new Cloud Spanner Backup.
|
|
855
|
-
* The returned backup {@link google.longrunning.Operation|long-running operation}
|
|
856
|
-
* will have a name of the format
|
|
857
|
-
* `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
|
|
858
|
-
* and can be used to track creation of the backup. The
|
|
859
|
-
* {@link google.longrunning.Operation.metadata|metadata} field type is
|
|
860
|
-
* {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. The
|
|
861
|
-
* {@link google.longrunning.Operation.response|response} field type is
|
|
862
|
-
* {@link google.spanner.admin.database.v1.Backup|Backup}, if successful. Cancelling the returned operation will stop the
|
|
863
|
-
* creation and delete the backup.
|
|
864
|
-
* There can be only one pending backup creation per database. Backup creation
|
|
865
|
-
* of different databases can run concurrently.
|
|
866
|
-
*
|
|
867
|
-
* @param {Object} request
|
|
868
|
-
* The request object that will be sent.
|
|
869
|
-
* @param {string} request.parent
|
|
870
|
-
* Required. The name of the instance in which the backup will be
|
|
871
|
-
* created. This must be the same instance that contains the database the
|
|
872
|
-
* backup will be created from. The backup will be stored in the
|
|
873
|
-
* location(s) specified in the instance configuration of this
|
|
874
|
-
* instance. Values are of the form
|
|
875
|
-
* `projects/<project>/instances/<instance>`.
|
|
876
|
-
* @param {string} request.backupId
|
|
877
|
-
* Required. The id of the backup to be created. The `backup_id` appended to
|
|
878
|
-
* `parent` forms the full backup name of the form
|
|
879
|
-
* `projects/<project>/instances/<instance>/backups/<backup_id>`.
|
|
880
|
-
* @param {google.spanner.admin.database.v1.Backup} request.backup
|
|
881
|
-
* Required. The backup to create.
|
|
882
|
-
* @param {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} [request.encryptionConfig]
|
|
883
|
-
* Optional. The encryption configuration used to encrypt the backup. If this field is
|
|
884
|
-
* not specified, the backup will use the same
|
|
885
|
-
* encryption configuration as the database by default, namely
|
|
886
|
-
* {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type|encryption_type} =
|
|
887
|
-
* `USE_DATABASE_ENCRYPTION`.
|
|
888
|
-
* @param {object} [options]
|
|
889
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
890
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
891
|
-
* The first element of the array is an object representing
|
|
892
|
-
* a long running operation. Its `promise()` method returns a promise
|
|
893
|
-
* you can `await` for.
|
|
894
|
-
* Please see the
|
|
895
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
896
|
-
* for more details and examples.
|
|
897
|
-
* @example
|
|
898
|
-
* const [operation] = await client.createBackup(request);
|
|
899
|
-
* const [response] = await operation.promise();
|
|
900
|
-
*/
|
|
901
545
|
createBackup(request, optionsOrCallback, callback) {
|
|
902
546
|
request = request || {};
|
|
903
547
|
let options;
|
|
@@ -927,11 +571,8 @@ class DatabaseAdminClient {
|
|
|
927
571
|
* Please see the
|
|
928
572
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
929
573
|
* for more details and examples.
|
|
930
|
-
* @example
|
|
931
|
-
*
|
|
932
|
-
* console.log(decodedOperation.result);
|
|
933
|
-
* console.log(decodedOperation.done);
|
|
934
|
-
* console.log(decodedOperation.metadata);
|
|
574
|
+
* @example <caption>include:samples/generated/v1/database_admin.create_backup.js</caption>
|
|
575
|
+
* region_tag:spanner_v1_generated_DatabaseAdmin_CreateBackup_async
|
|
935
576
|
*/
|
|
936
577
|
async checkCreateBackupProgress(name) {
|
|
937
578
|
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
@@ -939,61 +580,6 @@ class DatabaseAdminClient {
|
|
|
939
580
|
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createBackup, gax.createDefaultBackoffSettings());
|
|
940
581
|
return decodeOperation;
|
|
941
582
|
}
|
|
942
|
-
/**
|
|
943
|
-
* Create a new database by restoring from a completed backup. The new
|
|
944
|
-
* database must be in the same project and in an instance with the same
|
|
945
|
-
* instance configuration as the instance containing
|
|
946
|
-
* the backup. The returned database [long-running
|
|
947
|
-
* operation][google.longrunning.Operation] has a name of the format
|
|
948
|
-
* `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
|
|
949
|
-
* and can be used to track the progress of the operation, and to cancel it.
|
|
950
|
-
* The {@link google.longrunning.Operation.metadata|metadata} field type is
|
|
951
|
-
* {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}.
|
|
952
|
-
* The {@link google.longrunning.Operation.response|response} type
|
|
953
|
-
* is {@link google.spanner.admin.database.v1.Database|Database}, if
|
|
954
|
-
* successful. Cancelling the returned operation will stop the restore and
|
|
955
|
-
* delete the database.
|
|
956
|
-
* There can be only one database being restored into an instance at a time.
|
|
957
|
-
* Once the restore operation completes, a new restore operation can be
|
|
958
|
-
* initiated, without waiting for the optimize operation associated with the
|
|
959
|
-
* first restore to complete.
|
|
960
|
-
*
|
|
961
|
-
* @param {Object} request
|
|
962
|
-
* The request object that will be sent.
|
|
963
|
-
* @param {string} request.parent
|
|
964
|
-
* Required. The name of the instance in which to create the
|
|
965
|
-
* restored database. This instance must be in the same project and
|
|
966
|
-
* have the same instance configuration as the instance containing
|
|
967
|
-
* the source backup. Values are of the form
|
|
968
|
-
* `projects/<project>/instances/<instance>`.
|
|
969
|
-
* @param {string} request.databaseId
|
|
970
|
-
* Required. The id of the database to create and restore to. This
|
|
971
|
-
* database must not already exist. The `database_id` appended to
|
|
972
|
-
* `parent` forms the full database name of the form
|
|
973
|
-
* `projects/<project>/instances/<instance>/databases/<database_id>`.
|
|
974
|
-
* @param {string} request.backup
|
|
975
|
-
* Name of the backup from which to restore. Values are of the form
|
|
976
|
-
* `projects/<project>/instances/<instance>/backups/<backup>`.
|
|
977
|
-
* @param {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} [request.encryptionConfig]
|
|
978
|
-
* Optional. An encryption configuration describing the encryption type and key
|
|
979
|
-
* resources in Cloud KMS used to encrypt/decrypt the database to restore to.
|
|
980
|
-
* If this field is not specified, the restored database will use
|
|
981
|
-
* the same encryption configuration as the backup by default, namely
|
|
982
|
-
* {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type|encryption_type} =
|
|
983
|
-
* `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
|
|
984
|
-
* @param {object} [options]
|
|
985
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
986
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
987
|
-
* The first element of the array is an object representing
|
|
988
|
-
* a long running operation. Its `promise()` method returns a promise
|
|
989
|
-
* you can `await` for.
|
|
990
|
-
* Please see the
|
|
991
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
992
|
-
* for more details and examples.
|
|
993
|
-
* @example
|
|
994
|
-
* const [operation] = await client.restoreDatabase(request);
|
|
995
|
-
* const [response] = await operation.promise();
|
|
996
|
-
*/
|
|
997
583
|
restoreDatabase(request, optionsOrCallback, callback) {
|
|
998
584
|
request = request || {};
|
|
999
585
|
let options;
|
|
@@ -1023,11 +609,8 @@ class DatabaseAdminClient {
|
|
|
1023
609
|
* Please see the
|
|
1024
610
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
|
1025
611
|
* for more details and examples.
|
|
1026
|
-
* @example
|
|
1027
|
-
*
|
|
1028
|
-
* console.log(decodedOperation.result);
|
|
1029
|
-
* console.log(decodedOperation.done);
|
|
1030
|
-
* console.log(decodedOperation.metadata);
|
|
612
|
+
* @example <caption>include:samples/generated/v1/database_admin.restore_database.js</caption>
|
|
613
|
+
* region_tag:spanner_v1_generated_DatabaseAdmin_RestoreDatabase_async
|
|
1031
614
|
*/
|
|
1032
615
|
async checkRestoreDatabaseProgress(name) {
|
|
1033
616
|
const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
@@ -1035,34 +618,6 @@ class DatabaseAdminClient {
|
|
|
1035
618
|
const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restoreDatabase, gax.createDefaultBackoffSettings());
|
|
1036
619
|
return decodeOperation;
|
|
1037
620
|
}
|
|
1038
|
-
/**
|
|
1039
|
-
* Lists Cloud Spanner databases.
|
|
1040
|
-
*
|
|
1041
|
-
* @param {Object} request
|
|
1042
|
-
* The request object that will be sent.
|
|
1043
|
-
* @param {string} request.parent
|
|
1044
|
-
* Required. The instance whose databases should be listed.
|
|
1045
|
-
* Values are of the form `projects/<project>/instances/<instance>`.
|
|
1046
|
-
* @param {number} request.pageSize
|
|
1047
|
-
* Number of databases to be returned in the response. If 0 or less,
|
|
1048
|
-
* defaults to the server's maximum allowed page size.
|
|
1049
|
-
* @param {string} request.pageToken
|
|
1050
|
-
* If non-empty, `page_token` should contain a
|
|
1051
|
-
* {@link google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} from a
|
|
1052
|
-
* previous {@link google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}.
|
|
1053
|
-
* @param {object} [options]
|
|
1054
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1055
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
1056
|
-
* The first element of the array is Array of [Database]{@link google.spanner.admin.database.v1.Database}.
|
|
1057
|
-
* The client library will perform auto-pagination by default: it will call the API as many
|
|
1058
|
-
* times as needed and will merge results from all the pages into this array.
|
|
1059
|
-
* Note that it can affect your quota.
|
|
1060
|
-
* We recommend using `listDatabasesAsync()`
|
|
1061
|
-
* method described below for async iteration which you can stop as needed.
|
|
1062
|
-
* Please see the
|
|
1063
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1064
|
-
* for more details and examples.
|
|
1065
|
-
*/
|
|
1066
621
|
listDatabases(request, optionsOrCallback, callback) {
|
|
1067
622
|
request = request || {};
|
|
1068
623
|
let options;
|
|
@@ -1118,7 +673,8 @@ class DatabaseAdminClient {
|
|
|
1118
673
|
gax.routingHeader.fromParams({
|
|
1119
674
|
parent: request.parent || '',
|
|
1120
675
|
});
|
|
1121
|
-
const
|
|
676
|
+
const defaultCallSettings = this._defaults['listDatabases'];
|
|
677
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1122
678
|
this.initialize();
|
|
1123
679
|
return this.descriptors.page.listDatabases.createStream(this.innerApiCalls.listDatabases, request, callSettings);
|
|
1124
680
|
}
|
|
@@ -1148,11 +704,8 @@ class DatabaseAdminClient {
|
|
|
1148
704
|
* Please see the
|
|
1149
705
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1150
706
|
* for more details and examples.
|
|
1151
|
-
* @example
|
|
1152
|
-
*
|
|
1153
|
-
* for await (const response of iterable) {
|
|
1154
|
-
* // process response
|
|
1155
|
-
* }
|
|
707
|
+
* @example <caption>include:samples/generated/v1/database_admin.list_databases.js</caption>
|
|
708
|
+
* region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabases_async
|
|
1156
709
|
*/
|
|
1157
710
|
listDatabasesAsync(request, options) {
|
|
1158
711
|
request = request || {};
|
|
@@ -1163,78 +716,11 @@ class DatabaseAdminClient {
|
|
|
1163
716
|
gax.routingHeader.fromParams({
|
|
1164
717
|
parent: request.parent || '',
|
|
1165
718
|
});
|
|
1166
|
-
|
|
1167
|
-
const callSettings =
|
|
719
|
+
const defaultCallSettings = this._defaults['listDatabases'];
|
|
720
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1168
721
|
this.initialize();
|
|
1169
722
|
return this.descriptors.page.listDatabases.asyncIterate(this.innerApiCalls['listDatabases'], request, callSettings);
|
|
1170
723
|
}
|
|
1171
|
-
/**
|
|
1172
|
-
* Lists completed and pending backups.
|
|
1173
|
-
* Backups returned are ordered by `create_time` in descending order,
|
|
1174
|
-
* starting from the most recent `create_time`.
|
|
1175
|
-
*
|
|
1176
|
-
* @param {Object} request
|
|
1177
|
-
* The request object that will be sent.
|
|
1178
|
-
* @param {string} request.parent
|
|
1179
|
-
* Required. The instance to list backups from. Values are of the
|
|
1180
|
-
* form `projects/<project>/instances/<instance>`.
|
|
1181
|
-
* @param {string} request.filter
|
|
1182
|
-
* An expression that filters the list of returned backups.
|
|
1183
|
-
*
|
|
1184
|
-
* A filter expression consists of a field name, a comparison operator, and a
|
|
1185
|
-
* value for filtering.
|
|
1186
|
-
* The value must be a string, a number, or a boolean. The comparison operator
|
|
1187
|
-
* must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
|
|
1188
|
-
* Colon `:` is the contains operator. Filter rules are not case sensitive.
|
|
1189
|
-
*
|
|
1190
|
-
* The following fields in the {@link google.spanner.admin.database.v1.Backup|Backup} are eligible for filtering:
|
|
1191
|
-
*
|
|
1192
|
-
* * `name`
|
|
1193
|
-
* * `database`
|
|
1194
|
-
* * `state`
|
|
1195
|
-
* * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1196
|
-
* * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1197
|
-
* * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1198
|
-
* * `size_bytes`
|
|
1199
|
-
*
|
|
1200
|
-
* You can combine multiple expressions by enclosing each expression in
|
|
1201
|
-
* parentheses. By default, expressions are combined with AND logic, but
|
|
1202
|
-
* you can specify AND, OR, and NOT logic explicitly.
|
|
1203
|
-
*
|
|
1204
|
-
* Here are a few examples:
|
|
1205
|
-
*
|
|
1206
|
-
* * `name:Howl` - The backup's name contains the string "howl".
|
|
1207
|
-
* * `database:prod`
|
|
1208
|
-
* - The database's name contains the string "prod".
|
|
1209
|
-
* * `state:CREATING` - The backup is pending creation.
|
|
1210
|
-
* * `state:READY` - The backup is fully created and ready for use.
|
|
1211
|
-
* * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
|
|
1212
|
-
* - The backup name contains the string "howl" and `create_time`
|
|
1213
|
-
* of the backup is before 2018-03-28T14:50:00Z.
|
|
1214
|
-
* * `expire_time < \"2018-03-28T14:50:00Z\"`
|
|
1215
|
-
* - The backup `expire_time` is before 2018-03-28T14:50:00Z.
|
|
1216
|
-
* * `size_bytes > 10000000000` - The backup's size is greater than 10GB
|
|
1217
|
-
* @param {number} request.pageSize
|
|
1218
|
-
* Number of backups to be returned in the response. If 0 or
|
|
1219
|
-
* less, defaults to the server's maximum allowed page size.
|
|
1220
|
-
* @param {string} request.pageToken
|
|
1221
|
-
* If non-empty, `page_token` should contain a
|
|
1222
|
-
* {@link google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} from a
|
|
1223
|
-
* previous {@link google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} to the same `parent` and with the same
|
|
1224
|
-
* `filter`.
|
|
1225
|
-
* @param {object} [options]
|
|
1226
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1227
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
1228
|
-
* The first element of the array is Array of [Backup]{@link google.spanner.admin.database.v1.Backup}.
|
|
1229
|
-
* The client library will perform auto-pagination by default: it will call the API as many
|
|
1230
|
-
* times as needed and will merge results from all the pages into this array.
|
|
1231
|
-
* Note that it can affect your quota.
|
|
1232
|
-
* We recommend using `listBackupsAsync()`
|
|
1233
|
-
* method described below for async iteration which you can stop as needed.
|
|
1234
|
-
* Please see the
|
|
1235
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1236
|
-
* for more details and examples.
|
|
1237
|
-
*/
|
|
1238
724
|
listBackups(request, optionsOrCallback, callback) {
|
|
1239
725
|
request = request || {};
|
|
1240
726
|
let options;
|
|
@@ -1327,7 +813,8 @@ class DatabaseAdminClient {
|
|
|
1327
813
|
gax.routingHeader.fromParams({
|
|
1328
814
|
parent: request.parent || '',
|
|
1329
815
|
});
|
|
1330
|
-
const
|
|
816
|
+
const defaultCallSettings = this._defaults['listBackups'];
|
|
817
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1331
818
|
this.initialize();
|
|
1332
819
|
return this.descriptors.page.listBackups.createStream(this.innerApiCalls.listBackups, request, callSettings);
|
|
1333
820
|
}
|
|
@@ -1394,11 +881,8 @@ class DatabaseAdminClient {
|
|
|
1394
881
|
* Please see the
|
|
1395
882
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1396
883
|
* for more details and examples.
|
|
1397
|
-
* @example
|
|
1398
|
-
*
|
|
1399
|
-
* for await (const response of iterable) {
|
|
1400
|
-
* // process response
|
|
1401
|
-
* }
|
|
884
|
+
* @example <caption>include:samples/generated/v1/database_admin.list_backups.js</caption>
|
|
885
|
+
* region_tag:spanner_v1_generated_DatabaseAdmin_ListBackups_async
|
|
1402
886
|
*/
|
|
1403
887
|
listBackupsAsync(request, options) {
|
|
1404
888
|
request = request || {};
|
|
@@ -1409,88 +893,11 @@ class DatabaseAdminClient {
|
|
|
1409
893
|
gax.routingHeader.fromParams({
|
|
1410
894
|
parent: request.parent || '',
|
|
1411
895
|
});
|
|
1412
|
-
|
|
1413
|
-
const callSettings =
|
|
896
|
+
const defaultCallSettings = this._defaults['listBackups'];
|
|
897
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1414
898
|
this.initialize();
|
|
1415
899
|
return this.descriptors.page.listBackups.asyncIterate(this.innerApiCalls['listBackups'], request, callSettings);
|
|
1416
900
|
}
|
|
1417
|
-
/**
|
|
1418
|
-
* Lists database {@link google.longrunning.Operation|longrunning-operations}.
|
|
1419
|
-
* A database operation has a name of the form
|
|
1420
|
-
* `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
|
|
1421
|
-
* The long-running operation
|
|
1422
|
-
* {@link google.longrunning.Operation.metadata|metadata} field type
|
|
1423
|
-
* `metadata.type_url` describes the type of the metadata. Operations returned
|
|
1424
|
-
* include those that have completed/failed/canceled within the last 7 days,
|
|
1425
|
-
* and pending operations.
|
|
1426
|
-
*
|
|
1427
|
-
* @param {Object} request
|
|
1428
|
-
* The request object that will be sent.
|
|
1429
|
-
* @param {string} request.parent
|
|
1430
|
-
* Required. The instance of the database operations.
|
|
1431
|
-
* Values are of the form `projects/<project>/instances/<instance>`.
|
|
1432
|
-
* @param {string} request.filter
|
|
1433
|
-
* An expression that filters the list of returned operations.
|
|
1434
|
-
*
|
|
1435
|
-
* A filter expression consists of a field name, a
|
|
1436
|
-
* comparison operator, and a value for filtering.
|
|
1437
|
-
* The value must be a string, a number, or a boolean. The comparison operator
|
|
1438
|
-
* must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
|
|
1439
|
-
* Colon `:` is the contains operator. Filter rules are not case sensitive.
|
|
1440
|
-
*
|
|
1441
|
-
* The following fields in the {@link google.longrunning.Operation|Operation}
|
|
1442
|
-
* are eligible for filtering:
|
|
1443
|
-
*
|
|
1444
|
-
* * `name` - The name of the long-running operation
|
|
1445
|
-
* * `done` - False if the operation is in progress, else true.
|
|
1446
|
-
* * `metadata.@type` - the type of metadata. For example, the type string
|
|
1447
|
-
* for {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} is
|
|
1448
|
-
* `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
|
|
1449
|
-
* * `metadata.<field_name>` - any field in metadata.value.
|
|
1450
|
-
* * `error` - Error associated with the long-running operation.
|
|
1451
|
-
* * `response.@type` - the type of response.
|
|
1452
|
-
* * `response.<field_name>` - any field in response.value.
|
|
1453
|
-
*
|
|
1454
|
-
* You can combine multiple expressions by enclosing each expression in
|
|
1455
|
-
* parentheses. By default, expressions are combined with AND logic. However,
|
|
1456
|
-
* you can specify AND, OR, and NOT logic explicitly.
|
|
1457
|
-
*
|
|
1458
|
-
* Here are a few examples:
|
|
1459
|
-
*
|
|
1460
|
-
* * `done:true` - The operation is complete.
|
|
1461
|
-
* * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
|
|
1462
|
-
* `(metadata.source_type:BACKUP) AND` \
|
|
1463
|
-
* `(metadata.backup_info.backup:backup_howl) AND` \
|
|
1464
|
-
* `(metadata.name:restored_howl) AND` \
|
|
1465
|
-
* `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
|
|
1466
|
-
* `(error:*)` - Return operations where:
|
|
1467
|
-
* * The operation's metadata type is {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}.
|
|
1468
|
-
* * The database is restored from a backup.
|
|
1469
|
-
* * The backup name contains "backup_howl".
|
|
1470
|
-
* * The restored database's name contains "restored_howl".
|
|
1471
|
-
* * The operation started before 2018-03-28T14:50:00Z.
|
|
1472
|
-
* * The operation resulted in an error.
|
|
1473
|
-
* @param {number} request.pageSize
|
|
1474
|
-
* Number of operations to be returned in the response. If 0 or
|
|
1475
|
-
* less, defaults to the server's maximum allowed page size.
|
|
1476
|
-
* @param {string} request.pageToken
|
|
1477
|
-
* If non-empty, `page_token` should contain a
|
|
1478
|
-
* {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token}
|
|
1479
|
-
* from a previous {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} to the
|
|
1480
|
-
* same `parent` and with the same `filter`.
|
|
1481
|
-
* @param {object} [options]
|
|
1482
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1483
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
1484
|
-
* The first element of the array is Array of [Operation]{@link google.longrunning.Operation}.
|
|
1485
|
-
* The client library will perform auto-pagination by default: it will call the API as many
|
|
1486
|
-
* times as needed and will merge results from all the pages into this array.
|
|
1487
|
-
* Note that it can affect your quota.
|
|
1488
|
-
* We recommend using `listDatabaseOperationsAsync()`
|
|
1489
|
-
* method described below for async iteration which you can stop as needed.
|
|
1490
|
-
* Please see the
|
|
1491
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1492
|
-
* for more details and examples.
|
|
1493
|
-
*/
|
|
1494
901
|
listDatabaseOperations(request, optionsOrCallback, callback) {
|
|
1495
902
|
request = request || {};
|
|
1496
903
|
let options;
|
|
@@ -1588,7 +995,8 @@ class DatabaseAdminClient {
|
|
|
1588
995
|
gax.routingHeader.fromParams({
|
|
1589
996
|
parent: request.parent || '',
|
|
1590
997
|
});
|
|
1591
|
-
const
|
|
998
|
+
const defaultCallSettings = this._defaults['listDatabaseOperations'];
|
|
999
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1592
1000
|
this.initialize();
|
|
1593
1001
|
return this.descriptors.page.listDatabaseOperations.createStream(this.innerApiCalls.listDatabaseOperations, request, callSettings);
|
|
1594
1002
|
}
|
|
@@ -1660,11 +1068,8 @@ class DatabaseAdminClient {
|
|
|
1660
1068
|
* Please see the
|
|
1661
1069
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1662
1070
|
* for more details and examples.
|
|
1663
|
-
* @example
|
|
1664
|
-
*
|
|
1665
|
-
* for await (const response of iterable) {
|
|
1666
|
-
* // process response
|
|
1667
|
-
* }
|
|
1071
|
+
* @example <caption>include:samples/generated/v1/database_admin.list_database_operations.js</caption>
|
|
1072
|
+
* region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_async
|
|
1668
1073
|
*/
|
|
1669
1074
|
listDatabaseOperationsAsync(request, options) {
|
|
1670
1075
|
request = request || {};
|
|
@@ -1675,88 +1080,11 @@ class DatabaseAdminClient {
|
|
|
1675
1080
|
gax.routingHeader.fromParams({
|
|
1676
1081
|
parent: request.parent || '',
|
|
1677
1082
|
});
|
|
1678
|
-
|
|
1679
|
-
const callSettings =
|
|
1083
|
+
const defaultCallSettings = this._defaults['listDatabaseOperations'];
|
|
1084
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1680
1085
|
this.initialize();
|
|
1681
1086
|
return this.descriptors.page.listDatabaseOperations.asyncIterate(this.innerApiCalls['listDatabaseOperations'], request, callSettings);
|
|
1682
1087
|
}
|
|
1683
|
-
/**
|
|
1684
|
-
* Lists the backup {@link google.longrunning.Operation|long-running operations} in
|
|
1685
|
-
* the given instance. A backup operation has a name of the form
|
|
1686
|
-
* `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
|
|
1687
|
-
* The long-running operation
|
|
1688
|
-
* {@link google.longrunning.Operation.metadata|metadata} field type
|
|
1689
|
-
* `metadata.type_url` describes the type of the metadata. Operations returned
|
|
1690
|
-
* include those that have completed/failed/canceled within the last 7 days,
|
|
1691
|
-
* and pending operations. Operations returned are ordered by
|
|
1692
|
-
* `operation.metadata.value.progress.start_time` in descending order starting
|
|
1693
|
-
* from the most recently started operation.
|
|
1694
|
-
*
|
|
1695
|
-
* @param {Object} request
|
|
1696
|
-
* The request object that will be sent.
|
|
1697
|
-
* @param {string} request.parent
|
|
1698
|
-
* Required. The instance of the backup operations. Values are of
|
|
1699
|
-
* the form `projects/<project>/instances/<instance>`.
|
|
1700
|
-
* @param {string} request.filter
|
|
1701
|
-
* An expression that filters the list of returned backup operations.
|
|
1702
|
-
*
|
|
1703
|
-
* A filter expression consists of a field name, a
|
|
1704
|
-
* comparison operator, and a value for filtering.
|
|
1705
|
-
* The value must be a string, a number, or a boolean. The comparison operator
|
|
1706
|
-
* must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
|
|
1707
|
-
* Colon `:` is the contains operator. Filter rules are not case sensitive.
|
|
1708
|
-
*
|
|
1709
|
-
* The following fields in the {@link google.longrunning.Operation|operation}
|
|
1710
|
-
* are eligible for filtering:
|
|
1711
|
-
*
|
|
1712
|
-
* * `name` - The name of the long-running operation
|
|
1713
|
-
* * `done` - False if the operation is in progress, else true.
|
|
1714
|
-
* * `metadata.@type` - the type of metadata. For example, the type string
|
|
1715
|
-
* for {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} is
|
|
1716
|
-
* `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
|
|
1717
|
-
* * `metadata.<field_name>` - any field in metadata.value.
|
|
1718
|
-
* * `error` - Error associated with the long-running operation.
|
|
1719
|
-
* * `response.@type` - the type of response.
|
|
1720
|
-
* * `response.<field_name>` - any field in response.value.
|
|
1721
|
-
*
|
|
1722
|
-
* You can combine multiple expressions by enclosing each expression in
|
|
1723
|
-
* parentheses. By default, expressions are combined with AND logic, but
|
|
1724
|
-
* you can specify AND, OR, and NOT logic explicitly.
|
|
1725
|
-
*
|
|
1726
|
-
* Here are a few examples:
|
|
1727
|
-
*
|
|
1728
|
-
* * `done:true` - The operation is complete.
|
|
1729
|
-
* * `metadata.database:prod` - The database the backup was taken from has
|
|
1730
|
-
* a name containing the string "prod".
|
|
1731
|
-
* * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
|
|
1732
|
-
* `(metadata.name:howl) AND` \
|
|
1733
|
-
* `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
|
|
1734
|
-
* `(error:*)` - Returns operations where:
|
|
1735
|
-
* * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
|
|
1736
|
-
* * The backup name contains the string "howl".
|
|
1737
|
-
* * The operation started before 2018-03-28T14:50:00Z.
|
|
1738
|
-
* * The operation resulted in an error.
|
|
1739
|
-
* @param {number} request.pageSize
|
|
1740
|
-
* Number of operations to be returned in the response. If 0 or
|
|
1741
|
-
* less, defaults to the server's maximum allowed page size.
|
|
1742
|
-
* @param {string} request.pageToken
|
|
1743
|
-
* If non-empty, `page_token` should contain a
|
|
1744
|
-
* {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token}
|
|
1745
|
-
* from a previous {@link google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} to the
|
|
1746
|
-
* same `parent` and with the same `filter`.
|
|
1747
|
-
* @param {object} [options]
|
|
1748
|
-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1749
|
-
* @returns {Promise} - The promise which resolves to an array.
|
|
1750
|
-
* The first element of the array is Array of [Operation]{@link google.longrunning.Operation}.
|
|
1751
|
-
* The client library will perform auto-pagination by default: it will call the API as many
|
|
1752
|
-
* times as needed and will merge results from all the pages into this array.
|
|
1753
|
-
* Note that it can affect your quota.
|
|
1754
|
-
* We recommend using `listBackupOperationsAsync()`
|
|
1755
|
-
* method described below for async iteration which you can stop as needed.
|
|
1756
|
-
* Please see the
|
|
1757
|
-
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1758
|
-
* for more details and examples.
|
|
1759
|
-
*/
|
|
1760
1088
|
listBackupOperations(request, optionsOrCallback, callback) {
|
|
1761
1089
|
request = request || {};
|
|
1762
1090
|
let options;
|
|
@@ -1852,7 +1180,8 @@ class DatabaseAdminClient {
|
|
|
1852
1180
|
gax.routingHeader.fromParams({
|
|
1853
1181
|
parent: request.parent || '',
|
|
1854
1182
|
});
|
|
1855
|
-
const
|
|
1183
|
+
const defaultCallSettings = this._defaults['listBackupOperations'];
|
|
1184
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1856
1185
|
this.initialize();
|
|
1857
1186
|
return this.descriptors.page.listBackupOperations.createStream(this.innerApiCalls.listBackupOperations, request, callSettings);
|
|
1858
1187
|
}
|
|
@@ -1922,11 +1251,8 @@ class DatabaseAdminClient {
|
|
|
1922
1251
|
* Please see the
|
|
1923
1252
|
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
|
1924
1253
|
* for more details and examples.
|
|
1925
|
-
* @example
|
|
1926
|
-
*
|
|
1927
|
-
* for await (const response of iterable) {
|
|
1928
|
-
* // process response
|
|
1929
|
-
* }
|
|
1254
|
+
* @example <caption>include:samples/generated/v1/database_admin.list_backup_operations.js</caption>
|
|
1255
|
+
* region_tag:spanner_v1_generated_DatabaseAdmin_ListBackupOperations_async
|
|
1930
1256
|
*/
|
|
1931
1257
|
listBackupOperationsAsync(request, options) {
|
|
1932
1258
|
request = request || {};
|
|
@@ -1937,8 +1263,8 @@ class DatabaseAdminClient {
|
|
|
1937
1263
|
gax.routingHeader.fromParams({
|
|
1938
1264
|
parent: request.parent || '',
|
|
1939
1265
|
});
|
|
1940
|
-
|
|
1941
|
-
const callSettings =
|
|
1266
|
+
const defaultCallSettings = this._defaults['listBackupOperations'];
|
|
1267
|
+
const callSettings = defaultCallSettings.merge(options);
|
|
1942
1268
|
this.initialize();
|
|
1943
1269
|
return this.descriptors.page.listBackupOperations.asyncIterate(this.innerApiCalls['listBackupOperations'], request, callSettings);
|
|
1944
1270
|
}
|