@google-cloud/spanner 8.0.0 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +35 -0
- package/build/protos/google/spanner/v1/change_stream.proto +451 -0
- package/build/protos/google/spanner/v1/commit_response.proto +9 -4
- package/build/protos/google/spanner/v1/transaction.proto +40 -356
- package/build/protos/protos.d.ts +1521 -0
- package/build/protos/protos.js +3906 -0
- package/build/protos/protos.json +317 -1
- package/build/src/batch-transaction.js +2 -2
- package/build/src/codec.js +20 -21
- package/build/src/common-grpc/service.js +10 -10
- package/build/src/common.d.ts +1 -0
- package/build/src/common.js +9 -1
- package/build/src/database.d.ts +1 -0
- package/build/src/database.js +2 -0
- package/build/src/helper.d.ts +90 -0
- package/build/src/helper.js +154 -0
- package/build/src/index.d.ts +33 -0
- package/build/src/index.js +178 -8
- package/build/src/instrument.js +3 -2
- package/build/src/metrics/constants.d.ts +36 -0
- package/build/src/metrics/constants.js +106 -0
- package/build/src/metrics/external-types.d.ts +20 -0
- package/build/src/metrics/external-types.js +32 -0
- package/build/src/metrics/interceptor.d.ts +13 -0
- package/build/src/metrics/interceptor.js +87 -0
- package/build/src/metrics/metrics-tracer-factory.d.ts +165 -0
- package/build/src/metrics/metrics-tracer-factory.js +389 -0
- package/build/src/metrics/metrics-tracer.d.ts +204 -0
- package/build/src/metrics/metrics-tracer.js +371 -0
- package/build/src/metrics/spanner-metrics-exporter.d.ts +35 -0
- package/build/src/metrics/spanner-metrics-exporter.js +119 -0
- package/build/src/metrics/transform.d.ts +144 -0
- package/build/src/metrics/transform.js +272 -0
- package/build/src/partial-result-stream.js +9 -5
- package/build/src/session-factory.d.ts +34 -0
- package/build/src/session-factory.js +30 -0
- package/build/src/session-pool.js +1 -2
- package/build/src/transaction-runner.d.ts +1 -0
- package/build/src/transaction-runner.js +6 -0
- package/build/src/transaction.d.ts +42 -1
- package/build/src/transaction.js +192 -42
- package/build/src/v1/database_admin_client.d.ts +34 -0
- package/build/src/v1/database_admin_client.js +167 -1
- package/build/src/v1/database_admin_client_config.json +4 -0
- package/build/src/v1/instance_admin_client.d.ts +120 -0
- package/build/src/v1/instance_admin_client.js +312 -13
- package/build/src/v1/spanner_client.js +108 -0
- package/build/src/v1/spanner_proto_list.json +1 -0
- package/package.json +12 -5
|
@@ -191,7 +191,7 @@ class DatabaseAdminClient {
|
|
|
191
191
|
listDatabaseRoles: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databaseRoles'),
|
|
192
192
|
listBackupSchedules: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupSchedules'),
|
|
193
193
|
};
|
|
194
|
-
const protoFilesRoot = this._gaxModule.
|
|
194
|
+
const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
|
|
195
195
|
// This API contains "long-running operations", which return a
|
|
196
196
|
// an Operation object that allows for tracking of the operation,
|
|
197
197
|
// rather than holding a request open.
|
|
@@ -329,6 +329,7 @@ class DatabaseAdminClient {
|
|
|
329
329
|
'updateBackupSchedule',
|
|
330
330
|
'deleteBackupSchedule',
|
|
331
331
|
'listBackupSchedules',
|
|
332
|
+
'internalUpdateGraphOperation',
|
|
332
333
|
];
|
|
333
334
|
for (const methodName of databaseAdminStubMethods) {
|
|
334
335
|
const callPromise = this.databaseAdminStub.then(stub => (...args) => {
|
|
@@ -443,6 +444,15 @@ class DatabaseAdminClient {
|
|
|
443
444
|
?.then(([response, options, rawResponse]) => {
|
|
444
445
|
this._log.info('getDatabase response %j', response);
|
|
445
446
|
return [response, options, rawResponse];
|
|
447
|
+
})
|
|
448
|
+
.catch((error) => {
|
|
449
|
+
if (error &&
|
|
450
|
+
'statusDetails' in error &&
|
|
451
|
+
error.statusDetails instanceof Array) {
|
|
452
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
453
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
454
|
+
}
|
|
455
|
+
throw error;
|
|
446
456
|
});
|
|
447
457
|
}
|
|
448
458
|
dropDatabase(request, optionsOrCallback, callback) {
|
|
@@ -477,6 +487,15 @@ class DatabaseAdminClient {
|
|
|
477
487
|
?.then(([response, options, rawResponse]) => {
|
|
478
488
|
this._log.info('dropDatabase response %j', response);
|
|
479
489
|
return [response, options, rawResponse];
|
|
490
|
+
})
|
|
491
|
+
.catch((error) => {
|
|
492
|
+
if (error &&
|
|
493
|
+
'statusDetails' in error &&
|
|
494
|
+
error.statusDetails instanceof Array) {
|
|
495
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
496
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
497
|
+
}
|
|
498
|
+
throw error;
|
|
480
499
|
});
|
|
481
500
|
}
|
|
482
501
|
getDatabaseDdl(request, optionsOrCallback, callback) {
|
|
@@ -511,6 +530,15 @@ class DatabaseAdminClient {
|
|
|
511
530
|
?.then(([response, options, rawResponse]) => {
|
|
512
531
|
this._log.info('getDatabaseDdl response %j', response);
|
|
513
532
|
return [response, options, rawResponse];
|
|
533
|
+
})
|
|
534
|
+
.catch((error) => {
|
|
535
|
+
if (error &&
|
|
536
|
+
'statusDetails' in error &&
|
|
537
|
+
error.statusDetails instanceof Array) {
|
|
538
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
539
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
540
|
+
}
|
|
541
|
+
throw error;
|
|
514
542
|
});
|
|
515
543
|
}
|
|
516
544
|
setIamPolicy(request, optionsOrCallback, callback) {
|
|
@@ -545,6 +573,15 @@ class DatabaseAdminClient {
|
|
|
545
573
|
?.then(([response, options, rawResponse]) => {
|
|
546
574
|
this._log.info('setIamPolicy response %j', response);
|
|
547
575
|
return [response, options, rawResponse];
|
|
576
|
+
})
|
|
577
|
+
.catch((error) => {
|
|
578
|
+
if (error &&
|
|
579
|
+
'statusDetails' in error &&
|
|
580
|
+
error.statusDetails instanceof Array) {
|
|
581
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
582
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
583
|
+
}
|
|
584
|
+
throw error;
|
|
548
585
|
});
|
|
549
586
|
}
|
|
550
587
|
getIamPolicy(request, optionsOrCallback, callback) {
|
|
@@ -579,6 +616,15 @@ class DatabaseAdminClient {
|
|
|
579
616
|
?.then(([response, options, rawResponse]) => {
|
|
580
617
|
this._log.info('getIamPolicy response %j', response);
|
|
581
618
|
return [response, options, rawResponse];
|
|
619
|
+
})
|
|
620
|
+
.catch((error) => {
|
|
621
|
+
if (error &&
|
|
622
|
+
'statusDetails' in error &&
|
|
623
|
+
error.statusDetails instanceof Array) {
|
|
624
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
625
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
626
|
+
}
|
|
627
|
+
throw error;
|
|
582
628
|
});
|
|
583
629
|
}
|
|
584
630
|
testIamPermissions(request, optionsOrCallback, callback) {
|
|
@@ -613,6 +659,15 @@ class DatabaseAdminClient {
|
|
|
613
659
|
?.then(([response, options, rawResponse]) => {
|
|
614
660
|
this._log.info('testIamPermissions response %j', response);
|
|
615
661
|
return [response, options, rawResponse];
|
|
662
|
+
})
|
|
663
|
+
.catch((error) => {
|
|
664
|
+
if (error &&
|
|
665
|
+
'statusDetails' in error &&
|
|
666
|
+
error.statusDetails instanceof Array) {
|
|
667
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
668
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
669
|
+
}
|
|
670
|
+
throw error;
|
|
616
671
|
});
|
|
617
672
|
}
|
|
618
673
|
getBackup(request, optionsOrCallback, callback) {
|
|
@@ -647,6 +702,15 @@ class DatabaseAdminClient {
|
|
|
647
702
|
?.then(([response, options, rawResponse]) => {
|
|
648
703
|
this._log.info('getBackup response %j', response);
|
|
649
704
|
return [response, options, rawResponse];
|
|
705
|
+
})
|
|
706
|
+
.catch((error) => {
|
|
707
|
+
if (error &&
|
|
708
|
+
'statusDetails' in error &&
|
|
709
|
+
error.statusDetails instanceof Array) {
|
|
710
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
711
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
712
|
+
}
|
|
713
|
+
throw error;
|
|
650
714
|
});
|
|
651
715
|
}
|
|
652
716
|
updateBackup(request, optionsOrCallback, callback) {
|
|
@@ -681,6 +745,15 @@ class DatabaseAdminClient {
|
|
|
681
745
|
?.then(([response, options, rawResponse]) => {
|
|
682
746
|
this._log.info('updateBackup response %j', response);
|
|
683
747
|
return [response, options, rawResponse];
|
|
748
|
+
})
|
|
749
|
+
.catch((error) => {
|
|
750
|
+
if (error &&
|
|
751
|
+
'statusDetails' in error &&
|
|
752
|
+
error.statusDetails instanceof Array) {
|
|
753
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
754
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
755
|
+
}
|
|
756
|
+
throw error;
|
|
684
757
|
});
|
|
685
758
|
}
|
|
686
759
|
deleteBackup(request, optionsOrCallback, callback) {
|
|
@@ -715,6 +788,15 @@ class DatabaseAdminClient {
|
|
|
715
788
|
?.then(([response, options, rawResponse]) => {
|
|
716
789
|
this._log.info('deleteBackup response %j', response);
|
|
717
790
|
return [response, options, rawResponse];
|
|
791
|
+
})
|
|
792
|
+
.catch((error) => {
|
|
793
|
+
if (error &&
|
|
794
|
+
'statusDetails' in error &&
|
|
795
|
+
error.statusDetails instanceof Array) {
|
|
796
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
797
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
798
|
+
}
|
|
799
|
+
throw error;
|
|
718
800
|
});
|
|
719
801
|
}
|
|
720
802
|
addSplitPoints(request, optionsOrCallback, callback) {
|
|
@@ -749,6 +831,15 @@ class DatabaseAdminClient {
|
|
|
749
831
|
?.then(([response, options, rawResponse]) => {
|
|
750
832
|
this._log.info('addSplitPoints response %j', response);
|
|
751
833
|
return [response, options, rawResponse];
|
|
834
|
+
})
|
|
835
|
+
.catch((error) => {
|
|
836
|
+
if (error &&
|
|
837
|
+
'statusDetails' in error &&
|
|
838
|
+
error.statusDetails instanceof Array) {
|
|
839
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
840
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
841
|
+
}
|
|
842
|
+
throw error;
|
|
752
843
|
});
|
|
753
844
|
}
|
|
754
845
|
createBackupSchedule(request, optionsOrCallback, callback) {
|
|
@@ -783,6 +874,15 @@ class DatabaseAdminClient {
|
|
|
783
874
|
?.then(([response, options, rawResponse]) => {
|
|
784
875
|
this._log.info('createBackupSchedule response %j', response);
|
|
785
876
|
return [response, options, rawResponse];
|
|
877
|
+
})
|
|
878
|
+
.catch((error) => {
|
|
879
|
+
if (error &&
|
|
880
|
+
'statusDetails' in error &&
|
|
881
|
+
error.statusDetails instanceof Array) {
|
|
882
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
883
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
884
|
+
}
|
|
885
|
+
throw error;
|
|
786
886
|
});
|
|
787
887
|
}
|
|
788
888
|
getBackupSchedule(request, optionsOrCallback, callback) {
|
|
@@ -817,6 +917,15 @@ class DatabaseAdminClient {
|
|
|
817
917
|
?.then(([response, options, rawResponse]) => {
|
|
818
918
|
this._log.info('getBackupSchedule response %j', response);
|
|
819
919
|
return [response, options, rawResponse];
|
|
920
|
+
})
|
|
921
|
+
.catch((error) => {
|
|
922
|
+
if (error &&
|
|
923
|
+
'statusDetails' in error &&
|
|
924
|
+
error.statusDetails instanceof Array) {
|
|
925
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
926
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
927
|
+
}
|
|
928
|
+
throw error;
|
|
820
929
|
});
|
|
821
930
|
}
|
|
822
931
|
updateBackupSchedule(request, optionsOrCallback, callback) {
|
|
@@ -851,6 +960,15 @@ class DatabaseAdminClient {
|
|
|
851
960
|
?.then(([response, options, rawResponse]) => {
|
|
852
961
|
this._log.info('updateBackupSchedule response %j', response);
|
|
853
962
|
return [response, options, rawResponse];
|
|
963
|
+
})
|
|
964
|
+
.catch((error) => {
|
|
965
|
+
if (error &&
|
|
966
|
+
'statusDetails' in error &&
|
|
967
|
+
error.statusDetails instanceof Array) {
|
|
968
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
969
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
970
|
+
}
|
|
971
|
+
throw error;
|
|
854
972
|
});
|
|
855
973
|
}
|
|
856
974
|
deleteBackupSchedule(request, optionsOrCallback, callback) {
|
|
@@ -885,6 +1003,54 @@ class DatabaseAdminClient {
|
|
|
885
1003
|
?.then(([response, options, rawResponse]) => {
|
|
886
1004
|
this._log.info('deleteBackupSchedule response %j', response);
|
|
887
1005
|
return [response, options, rawResponse];
|
|
1006
|
+
})
|
|
1007
|
+
.catch((error) => {
|
|
1008
|
+
if (error &&
|
|
1009
|
+
'statusDetails' in error &&
|
|
1010
|
+
error.statusDetails instanceof Array) {
|
|
1011
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
1012
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
1013
|
+
}
|
|
1014
|
+
throw error;
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
internalUpdateGraphOperation(request, optionsOrCallback, callback) {
|
|
1018
|
+
request = request || {};
|
|
1019
|
+
let options;
|
|
1020
|
+
if (typeof optionsOrCallback === 'function' && callback === undefined) {
|
|
1021
|
+
callback = optionsOrCallback;
|
|
1022
|
+
options = {};
|
|
1023
|
+
}
|
|
1024
|
+
else {
|
|
1025
|
+
options = optionsOrCallback;
|
|
1026
|
+
}
|
|
1027
|
+
options = options || {};
|
|
1028
|
+
options.otherArgs = options.otherArgs || {};
|
|
1029
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1030
|
+
this.initialize().catch(err => {
|
|
1031
|
+
throw err;
|
|
1032
|
+
});
|
|
1033
|
+
this._log.info('internalUpdateGraphOperation request %j', request);
|
|
1034
|
+
const wrappedCallback = callback
|
|
1035
|
+
? (error, response, options, rawResponse) => {
|
|
1036
|
+
this._log.info('internalUpdateGraphOperation response %j', response);
|
|
1037
|
+
callback(error, response, options, rawResponse); // We verified callback above.
|
|
1038
|
+
}
|
|
1039
|
+
: undefined;
|
|
1040
|
+
return this.innerApiCalls
|
|
1041
|
+
.internalUpdateGraphOperation(request, options, wrappedCallback)
|
|
1042
|
+
?.then(([response, options, rawResponse]) => {
|
|
1043
|
+
this._log.info('internalUpdateGraphOperation response %j', response);
|
|
1044
|
+
return [response, options, rawResponse];
|
|
1045
|
+
})
|
|
1046
|
+
.catch((error) => {
|
|
1047
|
+
if (error &&
|
|
1048
|
+
'statusDetails' in error &&
|
|
1049
|
+
error.statusDetails instanceof Array) {
|
|
1050
|
+
const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
|
|
1051
|
+
error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
|
|
1052
|
+
}
|
|
1053
|
+
throw error;
|
|
888
1054
|
});
|
|
889
1055
|
}
|
|
890
1056
|
createDatabase(request, optionsOrCallback, callback) {
|
|
@@ -158,6 +158,10 @@
|
|
|
158
158
|
"timeout_millis": 3600000,
|
|
159
159
|
"retry_codes_name": "idempotent",
|
|
160
160
|
"retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799"
|
|
161
|
+
},
|
|
162
|
+
"InternalUpdateGraphOperation": {
|
|
163
|
+
"retry_codes_name": "non_idempotent",
|
|
164
|
+
"retry_params_name": "default"
|
|
161
165
|
}
|
|
162
166
|
}
|
|
163
167
|
}
|
|
@@ -1880,6 +1880,126 @@ export declare class InstanceAdminClient {
|
|
|
1880
1880
|
* for more details and examples.
|
|
1881
1881
|
*/
|
|
1882
1882
|
listInstancePartitionOperationsAsync(request?: protos.google.spanner.admin.instance.v1.IListInstancePartitionOperationsRequest, options?: CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;
|
|
1883
|
+
/**
|
|
1884
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
|
1885
|
+
* method to poll the operation result at intervals as recommended by the API
|
|
1886
|
+
* service.
|
|
1887
|
+
*
|
|
1888
|
+
* @param {Object} request - The request object that will be sent.
|
|
1889
|
+
* @param {string} request.name - The name of the operation resource.
|
|
1890
|
+
* @param {Object=} options
|
|
1891
|
+
* Optional parameters. You can override the default settings for this call,
|
|
1892
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
1893
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
|
1894
|
+
* for the details.
|
|
1895
|
+
* @param {function(?Error, ?Object)=} callback
|
|
1896
|
+
* The function which will be called with the result of the API call.
|
|
1897
|
+
*
|
|
1898
|
+
* The second parameter to the callback is an object representing
|
|
1899
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
|
1900
|
+
* @return {Promise} - The promise which resolves to an array.
|
|
1901
|
+
* The first element of the array is an object representing
|
|
1902
|
+
* {@link google.longrunning.Operation | google.longrunning.Operation}.
|
|
1903
|
+
* The promise has a method named "cancel" which cancels the ongoing API call.
|
|
1904
|
+
*
|
|
1905
|
+
* @example
|
|
1906
|
+
* ```
|
|
1907
|
+
* const client = longrunning.operationsClient();
|
|
1908
|
+
* const name = '';
|
|
1909
|
+
* const [response] = await client.getOperation({name});
|
|
1910
|
+
* // doThingsWith(response)
|
|
1911
|
+
* ```
|
|
1912
|
+
*/
|
|
1913
|
+
getOperation(request: protos.google.longrunning.GetOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;
|
|
1914
|
+
/**
|
|
1915
|
+
* Lists operations that match the specified filter in the request. If the
|
|
1916
|
+
* server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
|
|
1917
|
+
*
|
|
1918
|
+
* For-await-of syntax is used with the iterable to recursively get response element on-demand.
|
|
1919
|
+
*
|
|
1920
|
+
* @param {Object} request - The request object that will be sent.
|
|
1921
|
+
* @param {string} request.name - The name of the operation collection.
|
|
1922
|
+
* @param {string} request.filter - The standard list filter.
|
|
1923
|
+
* @param {number=} request.pageSize -
|
|
1924
|
+
* The maximum number of resources contained in the underlying API
|
|
1925
|
+
* response. If page streaming is performed per-resource, this
|
|
1926
|
+
* parameter does not affect the return value. If page streaming is
|
|
1927
|
+
* performed per-page, this determines the maximum number of
|
|
1928
|
+
* resources in a page.
|
|
1929
|
+
* @param {Object=} options
|
|
1930
|
+
* Optional parameters. You can override the default settings for this call,
|
|
1931
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
1932
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
|
|
1933
|
+
* details.
|
|
1934
|
+
* @returns {Object}
|
|
1935
|
+
* An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
|
|
1936
|
+
*
|
|
1937
|
+
* @example
|
|
1938
|
+
* ```
|
|
1939
|
+
* const client = longrunning.operationsClient();
|
|
1940
|
+
* for await (const response of client.listOperationsAsync(request));
|
|
1941
|
+
* // doThingsWith(response)
|
|
1942
|
+
* ```
|
|
1943
|
+
*/
|
|
1944
|
+
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;
|
|
1945
|
+
/**
|
|
1946
|
+
* Starts asynchronous cancellation on a long-running operation. The server
|
|
1947
|
+
* makes a best effort to cancel the operation, but success is not
|
|
1948
|
+
* guaranteed. If the server doesn't support this method, it returns
|
|
1949
|
+
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use
|
|
1950
|
+
* {@link Operations.GetOperation} or
|
|
1951
|
+
* other methods to check whether the cancellation succeeded or whether the
|
|
1952
|
+
* operation completed despite cancellation. On successful cancellation,
|
|
1953
|
+
* the operation is not deleted; instead, it becomes an operation with
|
|
1954
|
+
* an {@link Operation.error} value with a {@link google.rpc.Status.code} of
|
|
1955
|
+
* 1, corresponding to `Code.CANCELLED`.
|
|
1956
|
+
*
|
|
1957
|
+
* @param {Object} request - The request object that will be sent.
|
|
1958
|
+
* @param {string} request.name - The name of the operation resource to be cancelled.
|
|
1959
|
+
* @param {Object=} options
|
|
1960
|
+
* Optional parameters. You can override the default settings for this call,
|
|
1961
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
1962
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
|
|
1963
|
+
* details.
|
|
1964
|
+
* @param {function(?Error)=} callback
|
|
1965
|
+
* The function which will be called with the result of the API call.
|
|
1966
|
+
* @return {Promise} - The promise which resolves when API call finishes.
|
|
1967
|
+
* The promise has a method named "cancel" which cancels the ongoing API
|
|
1968
|
+
* call.
|
|
1969
|
+
*
|
|
1970
|
+
* @example
|
|
1971
|
+
* ```
|
|
1972
|
+
* const client = longrunning.operationsClient();
|
|
1973
|
+
* await client.cancelOperation({name: ''});
|
|
1974
|
+
* ```
|
|
1975
|
+
*/
|
|
1976
|
+
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;
|
|
1977
|
+
/**
|
|
1978
|
+
* Deletes a long-running operation. This method indicates that the client is
|
|
1979
|
+
* no longer interested in the operation result. It does not cancel the
|
|
1980
|
+
* operation. If the server doesn't support this method, it returns
|
|
1981
|
+
* `google.rpc.Code.UNIMPLEMENTED`.
|
|
1982
|
+
*
|
|
1983
|
+
* @param {Object} request - The request object that will be sent.
|
|
1984
|
+
* @param {string} request.name - The name of the operation resource to be deleted.
|
|
1985
|
+
* @param {Object=} options
|
|
1986
|
+
* Optional parameters. You can override the default settings for this call,
|
|
1987
|
+
* e.g, timeout, retries, paginations, etc. See {@link
|
|
1988
|
+
* https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
|
1989
|
+
* for the details.
|
|
1990
|
+
* @param {function(?Error)=} callback
|
|
1991
|
+
* The function which will be called with the result of the API call.
|
|
1992
|
+
* @return {Promise} - The promise which resolves when API call finishes.
|
|
1993
|
+
* The promise has a method named "cancel" which cancels the ongoing API
|
|
1994
|
+
* call.
|
|
1995
|
+
*
|
|
1996
|
+
* @example
|
|
1997
|
+
* ```
|
|
1998
|
+
* const client = longrunning.operationsClient();
|
|
1999
|
+
* await client.deleteOperation({name: ''});
|
|
2000
|
+
* ```
|
|
2001
|
+
*/
|
|
2002
|
+
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;
|
|
1883
2003
|
/**
|
|
1884
2004
|
* Return a fully-qualified instance resource name string.
|
|
1885
2005
|
*
|