3636from google .cloud .dataproc_v1 .proto import clusters_pb2_grpc
3737from google .cloud .dataproc_v1 .proto import operations_pb2 as proto_operations_pb2
3838from google .longrunning import operations_pb2 as longrunning_operations_pb2
39+ from google .protobuf import duration_pb2
3940from google .protobuf import empty_pb2
4041from google .protobuf import field_mask_pb2
4142
4647class ClusterControllerClient (object ):
4748 """
4849 The ClusterControllerService provides methods to manage clusters
49- of Google Compute Engine instances.
50+ of Compute Engine instances.
5051 """
5152
5253 SERVICE_ADDRESS = 'dataproc.googleapis.com:443'
@@ -177,6 +178,7 @@ def create_cluster(self,
177178 project_id ,
178179 region ,
179180 cluster ,
181+ request_id = None ,
180182 retry = google .api_core .gapic_v1 .method .DEFAULT ,
181183 timeout = google .api_core .gapic_v1 .method .DEFAULT ,
182184 metadata = None ):
@@ -216,6 +218,17 @@ def create_cluster(self,
216218
217219 If a dict is provided, it must be of the same form as the protobuf
218220 message :class:`~google.cloud.dataproc_v1.types.Cluster`
221+ request_id (str): Optional. A unique id used to identify the request. If the server
222+ receives two ``CreateClusterRequest`` requests with the same id, then
223+ the second request will be ignored and the first
224+ ``google.longrunning.Operation`` created and stored in the backend is
225+ returned.
226+
227+ It is recommended to always set this value to a
228+ `UUID <https://en.wikipedia.org/wiki/Universally_unique_identifier>`__.
229+
230+ The id must contain only letters (a-z, A-Z), numbers (0-9), underscores
231+ (\_), and hyphens (-). The maximum length is 40 characters.
219232 retry (Optional[google.api_core.retry.Retry]): A retry object used
220233 to retry requests. If ``None`` is specified, requests will not
221234 be retried.
@@ -250,6 +263,7 @@ def create_cluster(self,
250263 project_id = project_id ,
251264 region = region ,
252265 cluster = cluster ,
266+ request_id = request_id ,
253267 )
254268 operation = self ._inner_api_calls ['create_cluster' ](
255269 request , retry = retry , timeout = timeout , metadata = metadata )
@@ -266,6 +280,8 @@ def update_cluster(self,
266280 cluster_name ,
267281 cluster ,
268282 update_mask ,
283+ graceful_decommission_timeout = None ,
284+ request_id = None ,
269285 retry = google .api_core .gapic_v1 .method .DEFAULT ,
270286 timeout = google .api_core .gapic_v1 .method .DEFAULT ,
271287 metadata = None ):
@@ -343,138 +359,40 @@ def update_cluster(self,
343359 }
344360 }
345361
346- Note: Currently, only the following fields can be updated:
347-
348- .. raw:: html
349-
350- <table>
351-
352- .. raw:: html
353-
354- <tbody>
355-
356- .. raw:: html
357-
358- <tr>
359-
360- .. raw:: html
361-
362- <td>
363-
364- Mask
365-
366- .. raw:: html
367-
368- </td>
369-
370- .. raw:: html
371-
372- <td>
373-
374- Purpose
375-
376- .. raw:: html
377-
378- </td>
379-
380- .. raw:: html
381-
382- </tr>
383-
384- .. raw:: html
385-
386- <tr>
387-
388- .. raw:: html
389-
390- <td>
391-
392- labels
393-
394- .. raw:: html
395-
396- </td>
397-
398- .. raw:: html
399-
400- <td>
401-
402- Update labels
403-
404- .. raw:: html
405-
406- </td>
407-
408- .. raw:: html
409-
410- </tr>
411-
412- .. raw:: html
413-
414- <tr>
415-
416- .. raw:: html
417-
418- <td>
419-
420- config.worker\_config.num\_instances
421-
422- .. raw:: html
423-
424- </td>
425-
426- .. raw:: html
427-
428- <td>
429-
430- Resize primary worker group
431-
432- .. raw:: html
433-
434- </td>
435-
436- .. raw:: html
437-
438- </tr>
439-
440- .. raw:: html
441-
442- <tr>
443-
444- .. raw:: html
445-
446- <td>
447-
448- config.secondary\_worker\_config.num\_instances
449-
450- .. raw:: html
451-
452- </td>
453-
454- .. raw:: html
455-
456- <td>
457-
458- Resize secondary worker group
459-
460- .. raw:: html
461-
462- </td>
463-
464- .. raw:: html
465-
466- </tr>
362+ .. note::
467363
468- .. raw:: html
364+ Currently, only the following fields can be updated:
469365
470- </tbody>
366+ * ``labels``: Update labels
367+ * ``config.worker_config.num_instances``: Resize primary
368+ worker group
369+ * ``config.secondary_worker_config.num_instances``: Resize
370+ secondary worker group
471371
472- .. raw:: html
372+ If a dict is provided, it must be of the same form as the protobuf
373+ message :class:`~google.cloud.dataproc_v1.types.FieldMask`
374+ graceful_decommission_timeout (Union[dict, ~google.cloud.dataproc_v1.types.Duration]): Optional. Timeout for graceful YARN decomissioning. Graceful
375+ decommissioning allows removing nodes from the cluster without
376+ interrupting jobs in progress. Timeout specifies how long to wait for jobs
377+ in progress to finish before forcefully removing nodes (and potentially
378+ interrupting jobs). Default timeout is 0 (for forceful decommission), and
379+ the maximum allowed timeout is 1 day.
473380
474- </table>
381+ Only supported on Dataproc image versions 1.2 and higher.
475382
476383 If a dict is provided, it must be of the same form as the protobuf
477- message :class:`~google.cloud.dataproc_v1.types.FieldMask`
384+ message :class:`~google.cloud.dataproc_v1.types.Duration`
385+ request_id (str): Optional. A unique id used to identify the request. If the server
386+ receives two ``UpdateClusterRequest`` requests with the same id, then
387+ the second request will be ignored and the first
388+ ``google.longrunning.Operation`` created and stored in the backend is
389+ returned.
390+
391+ It is recommended to always set this value to a
392+ `UUID <https://en.wikipedia.org/wiki/Universally_unique_identifier>`__.
393+
394+ The id must contain only letters (a-z, A-Z), numbers (0-9), underscores
395+ (\_), and hyphens (-). The maximum length is 40 characters.
478396 retry (Optional[google.api_core.retry.Retry]): A retry object used
479397 to retry requests. If ``None`` is specified, requests will not
480398 be retried.
@@ -511,6 +429,8 @@ def update_cluster(self,
511429 cluster_name = cluster_name ,
512430 cluster = cluster ,
513431 update_mask = update_mask ,
432+ graceful_decommission_timeout = graceful_decommission_timeout ,
433+ request_id = request_id ,
514434 )
515435 operation = self ._inner_api_calls ['update_cluster' ](
516436 request , retry = retry , timeout = timeout , metadata = metadata )
@@ -525,6 +445,8 @@ def delete_cluster(self,
525445 project_id ,
526446 region ,
527447 cluster_name ,
448+ cluster_uuid = None ,
449+ request_id = None ,
528450 retry = google .api_core .gapic_v1 .method .DEFAULT ,
529451 timeout = google .api_core .gapic_v1 .method .DEFAULT ,
530452 metadata = None ):
@@ -561,6 +483,19 @@ def delete_cluster(self,
561483 belongs to.
562484 region (str): Required. The Cloud Dataproc region in which to handle the request.
563485 cluster_name (str): Required. The cluster name.
486+ cluster_uuid (str): Optional. Specifying the ``cluster_uuid`` means the RPC should fail
487+ (with error NOT\_FOUND) if cluster with specified UUID does not exist.
488+ request_id (str): Optional. A unique id used to identify the request. If the server
489+ receives two ``DeleteClusterRequest`` requests with the same id, then
490+ the second request will be ignored and the first
491+ ``google.longrunning.Operation`` created and stored in the backend is
492+ returned.
493+
494+ It is recommended to always set this value to a
495+ `UUID <https://en.wikipedia.org/wiki/Universally_unique_identifier>`__.
496+
497+ The id must contain only letters (a-z, A-Z), numbers (0-9), underscores
498+ (\_), and hyphens (-). The maximum length is 40 characters.
564499 retry (Optional[google.api_core.retry.Retry]): A retry object used
565500 to retry requests. If ``None`` is specified, requests will not
566501 be retried.
@@ -595,6 +530,8 @@ def delete_cluster(self,
595530 project_id = project_id ,
596531 region = region ,
597532 cluster_name = cluster_name ,
533+ cluster_uuid = cluster_uuid ,
534+ request_id = request_id ,
598535 )
599536 operation = self ._inner_api_calls ['delete_cluster' ](
600537 request , retry = retry , timeout = timeout , metadata = metadata )
0 commit comments