@google-cloud/spanner 7.13.0 → 7.15.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 +36 -0
- package/README.md +14 -2
- package/build/protos/google/spanner/admin/database/v1/backup.proto +9 -2
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +203 -62
- package/build/protos/protos.d.ts +338 -144
- package/build/protos/protos.js +864 -339
- package/build/protos/protos.json +83 -1
- package/build/src/batch-transaction.d.ts +1 -0
- package/build/src/batch-transaction.js +90 -50
- package/build/src/database.d.ts +5 -2
- package/build/src/database.js +430 -235
- package/build/src/index.d.ts +5 -0
- package/build/src/index.js +4 -0
- package/build/src/instance.d.ts +2 -0
- package/build/src/instance.js +6 -1
- package/build/src/instrument.d.ts +84 -0
- package/build/src/instrument.js +213 -0
- package/build/src/session-pool.d.ts +2 -0
- package/build/src/session-pool.js +61 -23
- package/build/src/session.js +1 -7
- package/build/src/table.d.ts +3 -0
- package/build/src/table.js +34 -14
- package/build/src/transaction.d.ts +3 -0
- package/build/src/transaction.js +411 -194
- package/build/src/v1/database_admin_client.d.ts +9 -0
- package/build/src/v1/database_admin_client.js +6 -0
- package/build/src/v1/instance_admin_client.d.ts +141 -43
- package/build/src/v1/instance_admin_client.js +44 -4
- package/build/src/v1/instance_admin_client_config.json +4 -0
- package/package.json +13 -4
|
@@ -1025,6 +1025,7 @@ export declare class DatabaseAdminClient {
|
|
|
1025
1025
|
* * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1026
1026
|
* * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1027
1027
|
* * `size_bytes`
|
|
1028
|
+
* * `backup_schedules`
|
|
1028
1029
|
*
|
|
1029
1030
|
* You can combine multiple expressions by enclosing each expression in
|
|
1030
1031
|
* parentheses. By default, expressions are combined with AND logic, but
|
|
@@ -1043,6 +1044,8 @@ export declare class DatabaseAdminClient {
|
|
|
1043
1044
|
* * `expire_time < \"2018-03-28T14:50:00Z\"`
|
|
1044
1045
|
* - The backup `expire_time` is before 2018-03-28T14:50:00Z.
|
|
1045
1046
|
* * `size_bytes > 10000000000` - The backup's size is greater than 10GB
|
|
1047
|
+
* * `backup_schedules:daily`
|
|
1048
|
+
* - The backup is created from a schedule with "daily" in its name.
|
|
1046
1049
|
* @param {number} request.pageSize
|
|
1047
1050
|
* Number of backups to be returned in the response. If 0 or
|
|
1048
1051
|
* less, defaults to the server's maximum allowed page size.
|
|
@@ -1098,6 +1101,7 @@ export declare class DatabaseAdminClient {
|
|
|
1098
1101
|
* * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1099
1102
|
* * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1100
1103
|
* * `size_bytes`
|
|
1104
|
+
* * `backup_schedules`
|
|
1101
1105
|
*
|
|
1102
1106
|
* You can combine multiple expressions by enclosing each expression in
|
|
1103
1107
|
* parentheses. By default, expressions are combined with AND logic, but
|
|
@@ -1116,6 +1120,8 @@ export declare class DatabaseAdminClient {
|
|
|
1116
1120
|
* * `expire_time < \"2018-03-28T14:50:00Z\"`
|
|
1117
1121
|
* - The backup `expire_time` is before 2018-03-28T14:50:00Z.
|
|
1118
1122
|
* * `size_bytes > 10000000000` - The backup's size is greater than 10GB
|
|
1123
|
+
* * `backup_schedules:daily`
|
|
1124
|
+
* - The backup is created from a schedule with "daily" in its name.
|
|
1119
1125
|
* @param {number} request.pageSize
|
|
1120
1126
|
* Number of backups to be returned in the response. If 0 or
|
|
1121
1127
|
* less, defaults to the server's maximum allowed page size.
|
|
@@ -1166,6 +1172,7 @@ export declare class DatabaseAdminClient {
|
|
|
1166
1172
|
* * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1167
1173
|
* * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1168
1174
|
* * `size_bytes`
|
|
1175
|
+
* * `backup_schedules`
|
|
1169
1176
|
*
|
|
1170
1177
|
* You can combine multiple expressions by enclosing each expression in
|
|
1171
1178
|
* parentheses. By default, expressions are combined with AND logic, but
|
|
@@ -1184,6 +1191,8 @@ export declare class DatabaseAdminClient {
|
|
|
1184
1191
|
* * `expire_time < \"2018-03-28T14:50:00Z\"`
|
|
1185
1192
|
* - The backup `expire_time` is before 2018-03-28T14:50:00Z.
|
|
1186
1193
|
* * `size_bytes > 10000000000` - The backup's size is greater than 10GB
|
|
1194
|
+
* * `backup_schedules:daily`
|
|
1195
|
+
* - The backup is created from a schedule with "daily" in its name.
|
|
1187
1196
|
* @param {number} request.pageSize
|
|
1188
1197
|
* Number of backups to be returned in the response. If 0 or
|
|
1189
1198
|
* less, defaults to the server's maximum allowed page size.
|
|
@@ -1032,6 +1032,7 @@ class DatabaseAdminClient {
|
|
|
1032
1032
|
* * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1033
1033
|
* * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1034
1034
|
* * `size_bytes`
|
|
1035
|
+
* * `backup_schedules`
|
|
1035
1036
|
*
|
|
1036
1037
|
* You can combine multiple expressions by enclosing each expression in
|
|
1037
1038
|
* parentheses. By default, expressions are combined with AND logic, but
|
|
@@ -1050,6 +1051,8 @@ class DatabaseAdminClient {
|
|
|
1050
1051
|
* * `expire_time < \"2018-03-28T14:50:00Z\"`
|
|
1051
1052
|
* - The backup `expire_time` is before 2018-03-28T14:50:00Z.
|
|
1052
1053
|
* * `size_bytes > 10000000000` - The backup's size is greater than 10GB
|
|
1054
|
+
* * `backup_schedules:daily`
|
|
1055
|
+
* - The backup is created from a schedule with "daily" in its name.
|
|
1053
1056
|
* @param {number} request.pageSize
|
|
1054
1057
|
* Number of backups to be returned in the response. If 0 or
|
|
1055
1058
|
* less, defaults to the server's maximum allowed page size.
|
|
@@ -1114,6 +1117,7 @@ class DatabaseAdminClient {
|
|
|
1114
1117
|
* * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1115
1118
|
* * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
|
1116
1119
|
* * `size_bytes`
|
|
1120
|
+
* * `backup_schedules`
|
|
1117
1121
|
*
|
|
1118
1122
|
* You can combine multiple expressions by enclosing each expression in
|
|
1119
1123
|
* parentheses. By default, expressions are combined with AND logic, but
|
|
@@ -1132,6 +1136,8 @@ class DatabaseAdminClient {
|
|
|
1132
1136
|
* * `expire_time < \"2018-03-28T14:50:00Z\"`
|
|
1133
1137
|
* - The backup `expire_time` is before 2018-03-28T14:50:00Z.
|
|
1134
1138
|
* * `size_bytes > 10000000000` - The backup's size is greater than 10GB
|
|
1139
|
+
* * `backup_schedules:daily`
|
|
1140
|
+
* - The backup is created from a schedule with "daily" in its name.
|
|
1135
1141
|
* @param {number} request.pageSize
|
|
1136
1142
|
* Number of backups to be returned in the response. If 0 or
|
|
1137
1143
|
* less, defaults to the server's maximum allowed page size.
|
|
@@ -158,11 +158,11 @@ export declare class InstanceAdminClient {
|
|
|
158
158
|
getInstanceConfig(request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.instance.v1.IInstanceConfig, protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest | null | undefined, {} | null | undefined>): void;
|
|
159
159
|
getInstanceConfig(request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, callback: Callback<protos.google.spanner.admin.instance.v1.IInstanceConfig, protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest | null | undefined, {} | null | undefined>): void;
|
|
160
160
|
/**
|
|
161
|
-
* Deletes the instance
|
|
161
|
+
* Deletes the instance configuration. Deletion is only allowed when no
|
|
162
162
|
* instances are using the configuration. If any instances are using
|
|
163
|
-
* the
|
|
163
|
+
* the configuration, returns `FAILED_PRECONDITION`.
|
|
164
164
|
*
|
|
165
|
-
* Only user
|
|
165
|
+
* Only user-managed configurations can be deleted.
|
|
166
166
|
*
|
|
167
167
|
* Authorization requires `spanner.instanceConfigs.delete` permission on
|
|
168
168
|
* the resource {@link protos.google.spanner.admin.instance.v1.InstanceConfig.name|name}.
|
|
@@ -175,12 +175,12 @@ export declare class InstanceAdminClient {
|
|
|
175
175
|
* `projects/<project>/instanceConfigs/<instance_config>`
|
|
176
176
|
* @param {string} request.etag
|
|
177
177
|
* Used for optimistic concurrency control as a way to help prevent
|
|
178
|
-
* simultaneous deletes of an instance
|
|
178
|
+
* simultaneous deletes of an instance configuration from overwriting each
|
|
179
179
|
* other. If not empty, the API
|
|
180
|
-
* only deletes the instance
|
|
181
|
-
* status of the requested instance
|
|
182
|
-
*
|
|
183
|
-
*
|
|
180
|
+
* only deletes the instance configuration when the etag provided matches the
|
|
181
|
+
* current status of the requested instance configuration. Otherwise, deletes
|
|
182
|
+
* the instance configuration without checking the current status of the
|
|
183
|
+
* requested instance configuration.
|
|
184
184
|
* @param {boolean} request.validateOnly
|
|
185
185
|
* An option to validate, but not actually execute, a request,
|
|
186
186
|
* and provide the same response.
|
|
@@ -413,38 +413,38 @@ export declare class InstanceAdminClient {
|
|
|
413
413
|
deleteInstancePartition(request: protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest | null | undefined, {} | null | undefined>): void;
|
|
414
414
|
deleteInstancePartition(request: protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.instance.v1.IDeleteInstancePartitionRequest | null | undefined, {} | null | undefined>): void;
|
|
415
415
|
/**
|
|
416
|
-
* Creates an instance
|
|
416
|
+
* Creates an instance configuration and begins preparing it to be used. The
|
|
417
417
|
* returned {@link protos.google.longrunning.Operation|long-running operation}
|
|
418
418
|
* can be used to track the progress of preparing the new
|
|
419
|
-
* instance
|
|
420
|
-
* named instance
|
|
421
|
-
* `ALREADY_EXISTS`.
|
|
419
|
+
* instance configuration. The instance configuration name is assigned by the
|
|
420
|
+
* caller. If the named instance configuration already exists,
|
|
421
|
+
* `CreateInstanceConfig` returns `ALREADY_EXISTS`.
|
|
422
422
|
*
|
|
423
423
|
* Immediately after the request returns:
|
|
424
424
|
*
|
|
425
|
-
* * The instance
|
|
426
|
-
* attributes. The instance
|
|
425
|
+
* * The instance configuration is readable via the API, with all requested
|
|
426
|
+
* attributes. The instance configuration's
|
|
427
427
|
* {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling}
|
|
428
428
|
* field is set to true. Its state is `CREATING`.
|
|
429
429
|
*
|
|
430
430
|
* While the operation is pending:
|
|
431
431
|
*
|
|
432
|
-
* * Cancelling the operation renders the instance
|
|
432
|
+
* * Cancelling the operation renders the instance configuration immediately
|
|
433
433
|
* unreadable via the API.
|
|
434
434
|
* * Except for deleting the creating resource, all other attempts to modify
|
|
435
|
-
* the instance
|
|
435
|
+
* the instance configuration are rejected.
|
|
436
436
|
*
|
|
437
437
|
* Upon completion of the returned operation:
|
|
438
438
|
*
|
|
439
439
|
* * Instances can be created using the instance configuration.
|
|
440
|
-
* * The instance
|
|
440
|
+
* * The instance configuration's
|
|
441
441
|
* {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling}
|
|
442
442
|
* field becomes false. Its state becomes `READY`.
|
|
443
443
|
*
|
|
444
444
|
* The returned {@link protos.google.longrunning.Operation|long-running operation} will
|
|
445
445
|
* have a name of the format
|
|
446
446
|
* `<instance_config_name>/operations/<operation_id>` and can be used to track
|
|
447
|
-
* creation of the instance
|
|
447
|
+
* creation of the instance configuration. The
|
|
448
448
|
* {@link protos.google.longrunning.Operation.metadata|metadata} field type is
|
|
449
449
|
* {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}.
|
|
450
450
|
* The {@link protos.google.longrunning.Operation.response|response} field type is
|
|
@@ -458,13 +458,13 @@ export declare class InstanceAdminClient {
|
|
|
458
458
|
* @param {Object} request
|
|
459
459
|
* The request object that will be sent.
|
|
460
460
|
* @param {string} request.parent
|
|
461
|
-
* Required. The name of the project in which to create the instance
|
|
462
|
-
* Values are of the form `projects/<project>`.
|
|
461
|
+
* Required. The name of the project in which to create the instance
|
|
462
|
+
* configuration. Values are of the form `projects/<project>`.
|
|
463
463
|
* @param {string} request.instanceConfigId
|
|
464
|
-
* Required. The ID of the instance
|
|
465
|
-
* of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64
|
|
464
|
+
* Required. The ID of the instance configuration to create. Valid identifiers
|
|
465
|
+
* are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64
|
|
466
466
|
* characters in length. The `custom-` prefix is required to avoid name
|
|
467
|
-
* conflicts with Google
|
|
467
|
+
* conflicts with Google-managed configurations.
|
|
468
468
|
* @param {google.spanner.admin.instance.v1.InstanceConfig} request.instanceConfig
|
|
469
469
|
* Required. The InstanceConfig proto of the configuration to create.
|
|
470
470
|
* instance_config.name must be
|
|
@@ -501,16 +501,16 @@ export declare class InstanceAdminClient {
|
|
|
501
501
|
*/
|
|
502
502
|
checkCreateInstanceConfigProgress(name: string): Promise<LROperation<protos.google.spanner.admin.instance.v1.InstanceConfig, protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata>>;
|
|
503
503
|
/**
|
|
504
|
-
* Updates an instance
|
|
504
|
+
* Updates an instance configuration. The returned
|
|
505
505
|
* {@link protos.google.longrunning.Operation|long-running operation} can be used to track
|
|
506
|
-
* the progress of updating the instance. If the named instance
|
|
507
|
-
* not exist, returns `NOT_FOUND`.
|
|
506
|
+
* the progress of updating the instance. If the named instance configuration
|
|
507
|
+
* does not exist, returns `NOT_FOUND`.
|
|
508
508
|
*
|
|
509
|
-
* Only user
|
|
509
|
+
* Only user-managed configurations can be updated.
|
|
510
510
|
*
|
|
511
511
|
* Immediately after the request returns:
|
|
512
512
|
*
|
|
513
|
-
* * The instance
|
|
513
|
+
* * The instance configuration's
|
|
514
514
|
* {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling}
|
|
515
515
|
* field is set to true.
|
|
516
516
|
*
|
|
@@ -520,23 +520,23 @@ export declare class InstanceAdminClient {
|
|
|
520
520
|
* {@link protos.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time|cancel_time}.
|
|
521
521
|
* The operation is guaranteed to succeed at undoing all changes, after
|
|
522
522
|
* which point it terminates with a `CANCELLED` status.
|
|
523
|
-
* * All other attempts to modify the instance
|
|
524
|
-
* * Reading the instance
|
|
523
|
+
* * All other attempts to modify the instance configuration are rejected.
|
|
524
|
+
* * Reading the instance configuration via the API continues to give the
|
|
525
525
|
* pre-request values.
|
|
526
526
|
*
|
|
527
527
|
* Upon completion of the returned operation:
|
|
528
528
|
*
|
|
529
529
|
* * Creating instances using the instance configuration uses the new
|
|
530
530
|
* values.
|
|
531
|
-
* * The
|
|
532
|
-
* * The instance
|
|
531
|
+
* * The new values of the instance configuration are readable via the API.
|
|
532
|
+
* * The instance configuration's
|
|
533
533
|
* {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|reconciling}
|
|
534
534
|
* field becomes false.
|
|
535
535
|
*
|
|
536
536
|
* The returned {@link protos.google.longrunning.Operation|long-running operation} will
|
|
537
537
|
* have a name of the format
|
|
538
538
|
* `<instance_config_name>/operations/<operation_id>` and can be used to track
|
|
539
|
-
* the instance
|
|
539
|
+
* the instance configuration modification. The
|
|
540
540
|
* {@link protos.google.longrunning.Operation.metadata|metadata} field type is
|
|
541
541
|
* {@link protos.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata|UpdateInstanceConfigMetadata}.
|
|
542
542
|
* The {@link protos.google.longrunning.Operation.response|response} field type is
|
|
@@ -549,8 +549,9 @@ export declare class InstanceAdminClient {
|
|
|
549
549
|
* @param {Object} request
|
|
550
550
|
* The request object that will be sent.
|
|
551
551
|
* @param {google.spanner.admin.instance.v1.InstanceConfig} request.instanceConfig
|
|
552
|
-
* Required. The user instance
|
|
553
|
-
* instance
|
|
552
|
+
* Required. The user instance configuration to update, which must always
|
|
553
|
+
* include the instance configuration name. Otherwise, only fields mentioned
|
|
554
|
+
* in
|
|
554
555
|
* {@link protos.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.update_mask|update_mask}
|
|
555
556
|
* need be included. To prevent conflicts of concurrent updates,
|
|
556
557
|
* {@link protos.google.spanner.admin.instance.v1.InstanceConfig.reconciling|etag} can
|
|
@@ -911,6 +912,103 @@ export declare class InstanceAdminClient {
|
|
|
911
912
|
* for more details and examples.
|
|
912
913
|
*/
|
|
913
914
|
checkUpdateInstancePartitionProgress(name: string): Promise<LROperation<protos.google.spanner.admin.instance.v1.InstancePartition, protos.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata>>;
|
|
915
|
+
/**
|
|
916
|
+
* Moves an instance to the target instance configuration. You can use the
|
|
917
|
+
* returned {@link protos.google.longrunning.Operation|long-running operation} to track
|
|
918
|
+
* the progress of moving the instance.
|
|
919
|
+
*
|
|
920
|
+
* `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of
|
|
921
|
+
* the following criteria:
|
|
922
|
+
*
|
|
923
|
+
* * Is undergoing a move to a different instance configuration
|
|
924
|
+
* * Has backups
|
|
925
|
+
* * Has an ongoing update
|
|
926
|
+
* * Contains any CMEK-enabled databases
|
|
927
|
+
* * Is a free trial instance
|
|
928
|
+
*
|
|
929
|
+
* While the operation is pending:
|
|
930
|
+
*
|
|
931
|
+
* * All other attempts to modify the instance, including changes to its
|
|
932
|
+
* compute capacity, are rejected.
|
|
933
|
+
* * The following database and backup admin operations are rejected:
|
|
934
|
+
*
|
|
935
|
+
* * `DatabaseAdmin.CreateDatabase`
|
|
936
|
+
* * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is
|
|
937
|
+
* specified in the request.)
|
|
938
|
+
* * `DatabaseAdmin.RestoreDatabase`
|
|
939
|
+
* * `DatabaseAdmin.CreateBackup`
|
|
940
|
+
* * `DatabaseAdmin.CopyBackup`
|
|
941
|
+
*
|
|
942
|
+
* * Both the source and target instance configurations are subject to
|
|
943
|
+
* hourly compute and storage charges.
|
|
944
|
+
* * The instance might experience higher read-write latencies and a higher
|
|
945
|
+
* transaction abort rate. However, moving an instance doesn't cause any
|
|
946
|
+
* downtime.
|
|
947
|
+
*
|
|
948
|
+
* The returned {@link protos.google.longrunning.Operation|long-running operation} has
|
|
949
|
+
* a name of the format
|
|
950
|
+
* `<instance_name>/operations/<operation_id>` and can be used to track
|
|
951
|
+
* the move instance operation. The
|
|
952
|
+
* {@link protos.google.longrunning.Operation.metadata|metadata} field type is
|
|
953
|
+
* {@link protos.google.spanner.admin.instance.v1.MoveInstanceMetadata|MoveInstanceMetadata}.
|
|
954
|
+
* The {@link protos.google.longrunning.Operation.response|response} field type is
|
|
955
|
+
* {@link protos.google.spanner.admin.instance.v1.Instance|Instance},
|
|
956
|
+
* if successful.
|
|
957
|
+
* Cancelling the operation sets its metadata's
|
|
958
|
+
* {@link protos.google.spanner.admin.instance.v1.MoveInstanceMetadata.cancel_time|cancel_time}.
|
|
959
|
+
* Cancellation is not immediate because it involves moving any data
|
|
960
|
+
* previously moved to the target instance configuration back to the original
|
|
961
|
+
* instance configuration. You can use this operation to track the progress of
|
|
962
|
+
* the cancellation. Upon successful completion of the cancellation, the
|
|
963
|
+
* operation terminates with `CANCELLED` status.
|
|
964
|
+
*
|
|
965
|
+
* If not cancelled, upon completion of the returned operation:
|
|
966
|
+
*
|
|
967
|
+
* * The instance successfully moves to the target instance
|
|
968
|
+
* configuration.
|
|
969
|
+
* * You are billed for compute and storage in target instance
|
|
970
|
+
* configuration.
|
|
971
|
+
*
|
|
972
|
+
* Authorization requires the `spanner.instances.update` permission on
|
|
973
|
+
* the resource {@link protos.google.spanner.admin.instance.v1.Instance|instance}.
|
|
974
|
+
*
|
|
975
|
+
* For more details, see
|
|
976
|
+
* [Move an instance](https://cloud.google.com/spanner/docs/move-instance).
|
|
977
|
+
*
|
|
978
|
+
* @param {Object} request
|
|
979
|
+
* The request object that will be sent.
|
|
980
|
+
* @param {string} request.name
|
|
981
|
+
* Required. The instance to move.
|
|
982
|
+
* Values are of the form `projects/<project>/instances/<instance>`.
|
|
983
|
+
* @param {string} request.targetConfig
|
|
984
|
+
* Required. The target instance configuration where to move the instance.
|
|
985
|
+
* Values are of the form `projects/<project>/instanceConfigs/<config>`.
|
|
986
|
+
* @param {object} [options]
|
|
987
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
988
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
989
|
+
* The first element of the array is an object representing
|
|
990
|
+
* a long running operation. Its `promise()` method returns a promise
|
|
991
|
+
* you can `await` for.
|
|
992
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
|
|
993
|
+
* for more details and examples.
|
|
994
|
+
*/
|
|
995
|
+
moveInstance(request?: protos.google.spanner.admin.instance.v1.IMoveInstanceRequest, options?: CallOptions): Promise<[
|
|
996
|
+
LROperation<protos.google.spanner.admin.instance.v1.IMoveInstanceResponse, protos.google.spanner.admin.instance.v1.IMoveInstanceMetadata>,
|
|
997
|
+
protos.google.longrunning.IOperation | undefined,
|
|
998
|
+
{} | undefined
|
|
999
|
+
]>;
|
|
1000
|
+
moveInstance(request: protos.google.spanner.admin.instance.v1.IMoveInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.instance.v1.IMoveInstanceResponse, protos.google.spanner.admin.instance.v1.IMoveInstanceMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
|
1001
|
+
moveInstance(request: protos.google.spanner.admin.instance.v1.IMoveInstanceRequest, callback: Callback<LROperation<protos.google.spanner.admin.instance.v1.IMoveInstanceResponse, protos.google.spanner.admin.instance.v1.IMoveInstanceMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
|
1002
|
+
/**
|
|
1003
|
+
* Check the status of the long running operation returned by `moveInstance()`.
|
|
1004
|
+
* @param {String} name
|
|
1005
|
+
* The operation name that will be passed.
|
|
1006
|
+
* @returns {Promise} - The promise which resolves to an object.
|
|
1007
|
+
* The decoded operation object has result and metadata field to get information from.
|
|
1008
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
|
|
1009
|
+
* for more details and examples.
|
|
1010
|
+
*/
|
|
1011
|
+
checkMoveInstanceProgress(name: string): Promise<LROperation<protos.google.spanner.admin.instance.v1.MoveInstanceResponse, protos.google.spanner.admin.instance.v1.MoveInstanceMetadata>>;
|
|
914
1012
|
/**
|
|
915
1013
|
* Lists the supported instance configurations for a given project.
|
|
916
1014
|
*
|
|
@@ -1005,9 +1103,9 @@ export declare class InstanceAdminClient {
|
|
|
1005
1103
|
*/
|
|
1006
1104
|
listInstanceConfigsAsync(request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.instance.v1.IInstanceConfig>;
|
|
1007
1105
|
/**
|
|
1008
|
-
* Lists the user-managed instance
|
|
1106
|
+
* Lists the user-managed instance configuration [long-running
|
|
1009
1107
|
* operations][google.longrunning.Operation] in the given project. An instance
|
|
1010
|
-
*
|
|
1108
|
+
* configuration operation has a name of the form
|
|
1011
1109
|
* `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`.
|
|
1012
1110
|
* The long-running operation
|
|
1013
1111
|
* {@link protos.google.longrunning.Operation.metadata|metadata} field type
|
|
@@ -1020,7 +1118,7 @@ export declare class InstanceAdminClient {
|
|
|
1020
1118
|
* @param {Object} request
|
|
1021
1119
|
* The request object that will be sent.
|
|
1022
1120
|
* @param {string} request.parent
|
|
1023
|
-
* Required. The project of the instance
|
|
1121
|
+
* Required. The project of the instance configuration operations.
|
|
1024
1122
|
* Values are of the form `projects/<project>`.
|
|
1025
1123
|
* @param {string} request.filter
|
|
1026
1124
|
* An expression that filters the list of returned operations.
|
|
@@ -1063,7 +1161,7 @@ export declare class InstanceAdminClient {
|
|
|
1063
1161
|
* `(error:*)` - Return operations where:
|
|
1064
1162
|
* * The operation's metadata type is
|
|
1065
1163
|
* {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}.
|
|
1066
|
-
* * The instance
|
|
1164
|
+
* * The instance configuration name contains "custom-config".
|
|
1067
1165
|
* * The operation started before 2021-03-28T14:50:00Z.
|
|
1068
1166
|
* * The operation resulted in an error.
|
|
1069
1167
|
* @param {number} request.pageSize
|
|
@@ -1099,7 +1197,7 @@ export declare class InstanceAdminClient {
|
|
|
1099
1197
|
* @param {Object} request
|
|
1100
1198
|
* The request object that will be sent.
|
|
1101
1199
|
* @param {string} request.parent
|
|
1102
|
-
* Required. The project of the instance
|
|
1200
|
+
* Required. The project of the instance configuration operations.
|
|
1103
1201
|
* Values are of the form `projects/<project>`.
|
|
1104
1202
|
* @param {string} request.filter
|
|
1105
1203
|
* An expression that filters the list of returned operations.
|
|
@@ -1142,7 +1240,7 @@ export declare class InstanceAdminClient {
|
|
|
1142
1240
|
* `(error:*)` - Return operations where:
|
|
1143
1241
|
* * The operation's metadata type is
|
|
1144
1242
|
* {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}.
|
|
1145
|
-
* * The instance
|
|
1243
|
+
* * The instance configuration name contains "custom-config".
|
|
1146
1244
|
* * The operation started before 2021-03-28T14:50:00Z.
|
|
1147
1245
|
* * The operation resulted in an error.
|
|
1148
1246
|
* @param {number} request.pageSize
|
|
@@ -1173,7 +1271,7 @@ export declare class InstanceAdminClient {
|
|
|
1173
1271
|
* @param {Object} request
|
|
1174
1272
|
* The request object that will be sent.
|
|
1175
1273
|
* @param {string} request.parent
|
|
1176
|
-
* Required. The project of the instance
|
|
1274
|
+
* Required. The project of the instance configuration operations.
|
|
1177
1275
|
* Values are of the form `projects/<project>`.
|
|
1178
1276
|
* @param {string} request.filter
|
|
1179
1277
|
* An expression that filters the list of returned operations.
|
|
@@ -1216,7 +1314,7 @@ export declare class InstanceAdminClient {
|
|
|
1216
1314
|
* `(error:*)` - Return operations where:
|
|
1217
1315
|
* * The operation's metadata type is
|
|
1218
1316
|
* {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}.
|
|
1219
|
-
* * The instance
|
|
1317
|
+
* * The instance configuration name contains "custom-config".
|
|
1220
1318
|
* * The operation started before 2021-03-28T14:50:00Z.
|
|
1221
1319
|
* * The operation resulted in an error.
|
|
1222
1320
|
* @param {number} request.pageSize
|
|
@@ -239,6 +239,8 @@ class InstanceAdminClient {
|
|
|
239
239
|
const createInstancePartitionMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata');
|
|
240
240
|
const updateInstancePartitionResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.InstancePartition');
|
|
241
241
|
const updateInstancePartitionMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata');
|
|
242
|
+
const moveInstanceResponse = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.MoveInstanceResponse');
|
|
243
|
+
const moveInstanceMetadata = protoFilesRoot.lookup('.google.spanner.admin.instance.v1.MoveInstanceMetadata');
|
|
242
244
|
this.descriptors.longrunning = {
|
|
243
245
|
createInstanceConfig: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createInstanceConfigResponse.decode.bind(createInstanceConfigResponse), createInstanceConfigMetadata.decode.bind(createInstanceConfigMetadata)),
|
|
244
246
|
updateInstanceConfig: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateInstanceConfigResponse.decode.bind(updateInstanceConfigResponse), updateInstanceConfigMetadata.decode.bind(updateInstanceConfigMetadata)),
|
|
@@ -246,6 +248,7 @@ class InstanceAdminClient {
|
|
|
246
248
|
updateInstance: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateInstanceResponse.decode.bind(updateInstanceResponse), updateInstanceMetadata.decode.bind(updateInstanceMetadata)),
|
|
247
249
|
createInstancePartition: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createInstancePartitionResponse.decode.bind(createInstancePartitionResponse), createInstancePartitionMetadata.decode.bind(createInstancePartitionMetadata)),
|
|
248
250
|
updateInstancePartition: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateInstancePartitionResponse.decode.bind(updateInstancePartitionResponse), updateInstancePartitionMetadata.decode.bind(updateInstancePartitionMetadata)),
|
|
251
|
+
moveInstance: new this._gaxModule.LongrunningDescriptor(this.operationsClient, moveInstanceResponse.decode.bind(moveInstanceResponse), moveInstanceMetadata.decode.bind(moveInstanceMetadata)),
|
|
249
252
|
};
|
|
250
253
|
// Put together the default options sent with requests.
|
|
251
254
|
this._defaults = this._gaxGrpc.constructSettings('google.spanner.admin.instance.v1.InstanceAdmin', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
|
@@ -301,6 +304,7 @@ class InstanceAdminClient {
|
|
|
301
304
|
'deleteInstancePartition',
|
|
302
305
|
'updateInstancePartition',
|
|
303
306
|
'listInstancePartitionOperations',
|
|
307
|
+
'moveInstance',
|
|
304
308
|
];
|
|
305
309
|
for (const methodName of instanceAdminStubMethods) {
|
|
306
310
|
const callPromise = this.instanceAdminStub.then(stub => (...args) => {
|
|
@@ -788,6 +792,42 @@ class InstanceAdminClient {
|
|
|
788
792
|
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInstancePartition, this._gaxModule.createDefaultBackoffSettings());
|
|
789
793
|
return decodeOperation;
|
|
790
794
|
}
|
|
795
|
+
moveInstance(request, optionsOrCallback, callback) {
|
|
796
|
+
var _a;
|
|
797
|
+
request = request || {};
|
|
798
|
+
let options;
|
|
799
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
800
|
+
callback = optionsOrCallback;
|
|
801
|
+
options = {};
|
|
802
|
+
}
|
|
803
|
+
else {
|
|
804
|
+
options = optionsOrCallback;
|
|
805
|
+
}
|
|
806
|
+
options = options || {};
|
|
807
|
+
options.otherArgs = options.otherArgs || {};
|
|
808
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
809
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
810
|
+
this._gaxModule.routingHeader.fromParams({
|
|
811
|
+
name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
|
|
812
|
+
});
|
|
813
|
+
this.initialize();
|
|
814
|
+
return this.innerApiCalls.moveInstance(request, options, callback);
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Check the status of the long running operation returned by `moveInstance()`.
|
|
818
|
+
* @param {String} name
|
|
819
|
+
* The operation name that will be passed.
|
|
820
|
+
* @returns {Promise} - The promise which resolves to an object.
|
|
821
|
+
* The decoded operation object has result and metadata field to get information from.
|
|
822
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
|
|
823
|
+
* for more details and examples.
|
|
824
|
+
*/
|
|
825
|
+
async checkMoveInstanceProgress(name) {
|
|
826
|
+
const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
|
|
827
|
+
const [operation] = await this.operationsClient.getOperation(request);
|
|
828
|
+
const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.moveInstance, this._gaxModule.createDefaultBackoffSettings());
|
|
829
|
+
return decodeOperation;
|
|
830
|
+
}
|
|
791
831
|
listInstanceConfigs(request, optionsOrCallback, callback) {
|
|
792
832
|
var _a;
|
|
793
833
|
request = request || {};
|
|
@@ -920,7 +960,7 @@ class InstanceAdminClient {
|
|
|
920
960
|
* @param {Object} request
|
|
921
961
|
* The request object that will be sent.
|
|
922
962
|
* @param {string} request.parent
|
|
923
|
-
* Required. The project of the instance
|
|
963
|
+
* Required. The project of the instance configuration operations.
|
|
924
964
|
* Values are of the form `projects/<project>`.
|
|
925
965
|
* @param {string} request.filter
|
|
926
966
|
* An expression that filters the list of returned operations.
|
|
@@ -963,7 +1003,7 @@ class InstanceAdminClient {
|
|
|
963
1003
|
* `(error:*)` - Return operations where:
|
|
964
1004
|
* * The operation's metadata type is
|
|
965
1005
|
* {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}.
|
|
966
|
-
* * The instance
|
|
1006
|
+
* * The instance configuration name contains "custom-config".
|
|
967
1007
|
* * The operation started before 2021-03-28T14:50:00Z.
|
|
968
1008
|
* * The operation resulted in an error.
|
|
969
1009
|
* @param {number} request.pageSize
|
|
@@ -1008,7 +1048,7 @@ class InstanceAdminClient {
|
|
|
1008
1048
|
* @param {Object} request
|
|
1009
1049
|
* The request object that will be sent.
|
|
1010
1050
|
* @param {string} request.parent
|
|
1011
|
-
* Required. The project of the instance
|
|
1051
|
+
* Required. The project of the instance configuration operations.
|
|
1012
1052
|
* Values are of the form `projects/<project>`.
|
|
1013
1053
|
* @param {string} request.filter
|
|
1014
1054
|
* An expression that filters the list of returned operations.
|
|
@@ -1051,7 +1091,7 @@ class InstanceAdminClient {
|
|
|
1051
1091
|
* `(error:*)` - Return operations where:
|
|
1052
1092
|
* * The operation's metadata type is
|
|
1053
1093
|
* {@link protos.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata|CreateInstanceConfigMetadata}.
|
|
1054
|
-
* * The instance
|
|
1094
|
+
* * The instance configuration name contains "custom-config".
|
|
1055
1095
|
* * The operation started before 2021-03-28T14:50:00Z.
|
|
1056
1096
|
* * The operation resulted in an error.
|
|
1057
1097
|
* @param {number} request.pageSize
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-cloud/spanner",
|
|
3
3
|
"description": "Cloud Spanner Client Library for Node.js",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.15.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Google Inc.",
|
|
7
7
|
"engines": {
|
|
@@ -33,8 +33,9 @@
|
|
|
33
33
|
"samples-test-with-archived": "cd samples/ && npm link ../ && npm test-with-archived && cd ../",
|
|
34
34
|
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
|
|
35
35
|
"system-test": "mocha build/system-test --timeout 1600000",
|
|
36
|
+
"observability-test": "mocha build/observability-test --timeout 1600000",
|
|
36
37
|
"cleanup": "mocha scripts/cleanup.js --timeout 30000",
|
|
37
|
-
"test": "mocha build/test build/test/common",
|
|
38
|
+
"test": "mocha build/test build/test/common build/observability-test",
|
|
38
39
|
"ycsb": "node ./benchmark/ycsb.js run -P ./benchmark/workloada -p table=usertable -p cloudspanner.instance=ycsb-instance -p operationcount=100 -p cloudspanner.database=ycsb",
|
|
39
40
|
"fix": "gts fix",
|
|
40
41
|
"clean": "gts clean",
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
"prepare": "npm run compile-protos && npm run compile",
|
|
43
44
|
"pretest": "npm run compile",
|
|
44
45
|
"presystem-test": "npm run compile",
|
|
46
|
+
"preobservability-test": "npm run compile",
|
|
45
47
|
"proto": "compileProtos src",
|
|
46
48
|
"docs-test": "linkinator docs",
|
|
47
49
|
"predocs-test": "npm run docs",
|
|
@@ -57,6 +59,9 @@
|
|
|
57
59
|
"@google-cloud/projectify": "^4.0.0",
|
|
58
60
|
"@google-cloud/promisify": "^4.0.0",
|
|
59
61
|
"@grpc/proto-loader": "^0.7.0",
|
|
62
|
+
"@opentelemetry/api": "^1.9.0",
|
|
63
|
+
"@opentelemetry/context-async-hooks": "^1.26.0",
|
|
64
|
+
"@opentelemetry/semantic-conventions": "^1.25.1",
|
|
60
65
|
"@types/big.js": "^6.0.0",
|
|
61
66
|
"@types/stack-trace": "0.0.33",
|
|
62
67
|
"arrify": "^2.0.0",
|
|
@@ -66,7 +71,7 @@
|
|
|
66
71
|
"events-intercept": "^2.0.0",
|
|
67
72
|
"extend": "^3.0.2",
|
|
68
73
|
"google-auth-library": "^9.0.0",
|
|
69
|
-
"google-gax": "4.3.
|
|
74
|
+
"google-gax": "4.3.9",
|
|
70
75
|
"grpc-gcp": "^1.0.0",
|
|
71
76
|
"is": "^3.2.1",
|
|
72
77
|
"lodash.snakecase": "^4.1.1",
|
|
@@ -81,6 +86,8 @@
|
|
|
81
86
|
"through2": "^4.0.0"
|
|
82
87
|
},
|
|
83
88
|
"devDependencies": {
|
|
89
|
+
"@opentelemetry/sdk-trace-base": "^1.26.0",
|
|
90
|
+
"@opentelemetry/sdk-trace-node": "^1.26.0",
|
|
84
91
|
"@types/concat-stream": "^2.0.0",
|
|
85
92
|
"@types/extend": "^3.0.0",
|
|
86
93
|
"@types/is": "0.0.25",
|
|
@@ -105,12 +112,14 @@
|
|
|
105
112
|
"jsdoc": "^4.0.0",
|
|
106
113
|
"jsdoc-fresh": "^3.0.0",
|
|
107
114
|
"jsdoc-region-tag": "^3.0.0",
|
|
108
|
-
"linkinator": "^
|
|
115
|
+
"linkinator": "^3.0.0",
|
|
109
116
|
"lodash.random": "^3.2.0",
|
|
110
117
|
"mocha": "^9.2.2",
|
|
111
118
|
"mv": "^2.1.1",
|
|
112
119
|
"ncp": "^2.0.0",
|
|
120
|
+
"nise": "6.0.0",
|
|
113
121
|
"p-limit": "^3.0.1",
|
|
122
|
+
"path-to-regexp": "6.2.2",
|
|
114
123
|
"proxyquire": "^2.0.1",
|
|
115
124
|
"sinon": "^18.0.0",
|
|
116
125
|
"stats-lite": "^2.1.1",
|