@@ -32,7 +32,7 @@ import {Transform} from 'stream';
32
32
import { RequestType } from 'google-gax/build/src/apitypes' ;
33
33
import * as protos from '../../protos/protos' ;
34
34
import * as gapicConfig from './cluster_controller_client_config.json' ;
35
-
35
+ import { operationsProtos } from 'google-gax' ;
36
36
const version = require ( '../../../package.json' ) . version ;
37
37
38
38
/**
@@ -582,6 +582,42 @@ export class ClusterControllerClient {
582
582
this . initialize ( ) ;
583
583
return this . innerApiCalls . createCluster ( request , options , callback ) ;
584
584
}
585
+ /**
586
+ * Check the status of the long running operation returned by the createCluster() method.
587
+ * @param {String } name
588
+ * The operation name that will be passed.
589
+ * @returns {Promise } - The promise which resolves to an object.
590
+ * The decoded operation object has result and metadata field to get information from.
591
+ *
592
+ * @example :
593
+ * const decodedOperation = await checkCreateClusterProgress(name);
594
+ * console.log(decodedOperation.result);
595
+ * console.log(decodedOperation.done);
596
+ * console.log(decodedOperation.metadata);
597
+ *
598
+ */
599
+ async checkCreateClusterProgress (
600
+ name : string
601
+ ) : Promise <
602
+ LROperation <
603
+ protos . google . cloud . dataproc . v1 . Cluster ,
604
+ protos . google . cloud . dataproc . v1 . ClusterOperationMetadata
605
+ >
606
+ > {
607
+ const request = new operationsProtos . google . longrunning . GetOperationRequest (
608
+ { name}
609
+ ) ;
610
+ const [ operation ] = await this . operationsClient . getOperation ( request ) ;
611
+ const decodeOperation = new gax . Operation (
612
+ operation ,
613
+ this . descriptors . longrunning . createCluster ,
614
+ gax . createDefaultBackoffSettings ( )
615
+ ) ;
616
+ return decodeOperation as LROperation <
617
+ protos . google . cloud . dataproc . v1 . Cluster ,
618
+ protos . google . cloud . dataproc . v1 . ClusterOperationMetadata
619
+ > ;
620
+ }
585
621
updateCluster (
586
622
request : protos . google . cloud . dataproc . v1 . IUpdateClusterRequest ,
587
623
options ?: gax . CallOptions
@@ -763,6 +799,42 @@ export class ClusterControllerClient {
763
799
this . initialize ( ) ;
764
800
return this . innerApiCalls . updateCluster ( request , options , callback ) ;
765
801
}
802
+ /**
803
+ * Check the status of the long running operation returned by the updateCluster() method.
804
+ * @param {String } name
805
+ * The operation name that will be passed.
806
+ * @returns {Promise } - The promise which resolves to an object.
807
+ * The decoded operation object has result and metadata field to get information from.
808
+ *
809
+ * @example :
810
+ * const decodedOperation = await checkUpdateClusterProgress(name);
811
+ * console.log(decodedOperation.result);
812
+ * console.log(decodedOperation.done);
813
+ * console.log(decodedOperation.metadata);
814
+ *
815
+ */
816
+ async checkUpdateClusterProgress (
817
+ name : string
818
+ ) : Promise <
819
+ LROperation <
820
+ protos . google . cloud . dataproc . v1 . Cluster ,
821
+ protos . google . cloud . dataproc . v1 . ClusterOperationMetadata
822
+ >
823
+ > {
824
+ const request = new operationsProtos . google . longrunning . GetOperationRequest (
825
+ { name}
826
+ ) ;
827
+ const [ operation ] = await this . operationsClient . getOperation ( request ) ;
828
+ const decodeOperation = new gax . Operation (
829
+ operation ,
830
+ this . descriptors . longrunning . updateCluster ,
831
+ gax . createDefaultBackoffSettings ( )
832
+ ) ;
833
+ return decodeOperation as LROperation <
834
+ protos . google . cloud . dataproc . v1 . Cluster ,
835
+ protos . google . cloud . dataproc . v1 . ClusterOperationMetadata
836
+ > ;
837
+ }
766
838
deleteCluster (
767
839
request : protos . google . cloud . dataproc . v1 . IDeleteClusterRequest ,
768
840
options ?: gax . CallOptions
@@ -883,6 +955,42 @@ export class ClusterControllerClient {
883
955
this . initialize ( ) ;
884
956
return this . innerApiCalls . deleteCluster ( request , options , callback ) ;
885
957
}
958
+ /**
959
+ * Check the status of the long running operation returned by the deleteCluster() method.
960
+ * @param {String } name
961
+ * The operation name that will be passed.
962
+ * @returns {Promise } - The promise which resolves to an object.
963
+ * The decoded operation object has result and metadata field to get information from.
964
+ *
965
+ * @example :
966
+ * const decodedOperation = await checkDeleteClusterProgress(name);
967
+ * console.log(decodedOperation.result);
968
+ * console.log(decodedOperation.done);
969
+ * console.log(decodedOperation.metadata);
970
+ *
971
+ */
972
+ async checkDeleteClusterProgress (
973
+ name : string
974
+ ) : Promise <
975
+ LROperation <
976
+ protos . google . protobuf . Empty ,
977
+ protos . google . cloud . dataproc . v1 . ClusterOperationMetadata
978
+ >
979
+ > {
980
+ const request = new operationsProtos . google . longrunning . GetOperationRequest (
981
+ { name}
982
+ ) ;
983
+ const [ operation ] = await this . operationsClient . getOperation ( request ) ;
984
+ const decodeOperation = new gax . Operation (
985
+ operation ,
986
+ this . descriptors . longrunning . deleteCluster ,
987
+ gax . createDefaultBackoffSettings ( )
988
+ ) ;
989
+ return decodeOperation as LROperation <
990
+ protos . google . protobuf . Empty ,
991
+ protos . google . cloud . dataproc . v1 . ClusterOperationMetadata
992
+ > ;
993
+ }
886
994
diagnoseCluster (
887
995
request : protos . google . cloud . dataproc . v1 . IDiagnoseClusterRequest ,
888
996
options ?: gax . CallOptions
@@ -992,6 +1100,42 @@ export class ClusterControllerClient {
992
1100
this . initialize ( ) ;
993
1101
return this . innerApiCalls . diagnoseCluster ( request , options , callback ) ;
994
1102
}
1103
+ /**
1104
+ * Check the status of the long running operation returned by the diagnoseCluster() method.
1105
+ * @param {String } name
1106
+ * The operation name that will be passed.
1107
+ * @returns {Promise } - The promise which resolves to an object.
1108
+ * The decoded operation object has result and metadata field to get information from.
1109
+ *
1110
+ * @example :
1111
+ * const decodedOperation = await checkDiagnoseClusterProgress(name);
1112
+ * console.log(decodedOperation.result);
1113
+ * console.log(decodedOperation.done);
1114
+ * console.log(decodedOperation.metadata);
1115
+ *
1116
+ */
1117
+ async checkDiagnoseClusterProgress (
1118
+ name : string
1119
+ ) : Promise <
1120
+ LROperation <
1121
+ protos . google . protobuf . Empty ,
1122
+ protos . google . cloud . dataproc . v1 . DiagnoseClusterResults
1123
+ >
1124
+ > {
1125
+ const request = new operationsProtos . google . longrunning . GetOperationRequest (
1126
+ { name}
1127
+ ) ;
1128
+ const [ operation ] = await this . operationsClient . getOperation ( request ) ;
1129
+ const decodeOperation = new gax . Operation (
1130
+ operation ,
1131
+ this . descriptors . longrunning . diagnoseCluster ,
1132
+ gax . createDefaultBackoffSettings ( )
1133
+ ) ;
1134
+ return decodeOperation as LROperation <
1135
+ protos . google . protobuf . Empty ,
1136
+ protos . google . cloud . dataproc . v1 . DiagnoseClusterResults
1137
+ > ;
1138
+ }
995
1139
listClusters (
996
1140
request : protos . google . cloud . dataproc . v1 . IListClustersRequest ,
997
1141
options ?: gax . CallOptions
0 commit comments