Skip to content

Commit 3a51a1f

Browse files
authored
Add 'WorkflowTemplateServiceClient', optional args; update timeouts (via synth). (googleapis#6655)
Fixes moar PCRE -> raw-latex mess in docstrings. Closes googleapis#6644.
1 parent b76d094 commit 3a51a1f

31 files changed

Lines changed: 5283 additions & 762 deletions

dataproc/google/cloud/dataproc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
from google.cloud.dataproc_v1 import ClusterControllerClient
2020
from google.cloud.dataproc_v1 import JobControllerClient
21+
from google.cloud.dataproc_v1 import WorkflowTemplateServiceClient
2122
from google.cloud.dataproc_v1 import enums
2223
from google.cloud.dataproc_v1 import types
2324

@@ -26,4 +27,5 @@
2627
'types',
2728
'ClusterControllerClient',
2829
'JobControllerClient',
30+
'WorkflowTemplateServiceClient',
2931
)

dataproc/google/cloud/dataproc_v1/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from google.cloud.dataproc_v1.gapic import cluster_controller_client
2121
from google.cloud.dataproc_v1.gapic import enums
2222
from google.cloud.dataproc_v1.gapic import job_controller_client
23+
from google.cloud.dataproc_v1.gapic import workflow_template_service_client
2324

2425

2526
class ClusterControllerClient(
@@ -33,9 +34,16 @@ class JobControllerClient(job_controller_client.JobControllerClient):
3334
enums = enums
3435

3536

37+
class WorkflowTemplateServiceClient(
38+
workflow_template_service_client.WorkflowTemplateServiceClient):
39+
__doc__ = workflow_template_service_client.WorkflowTemplateServiceClient.__doc__
40+
enums = enums
41+
42+
3643
__all__ = (
3744
'enums',
3845
'types',
3946
'ClusterControllerClient',
4047
'JobControllerClient',
48+
'WorkflowTemplateServiceClient',
4149
)

dataproc/google/cloud/dataproc_v1/gapic/cluster_controller_client.py

Lines changed: 64 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from google.cloud.dataproc_v1.proto import clusters_pb2_grpc
3737
from google.cloud.dataproc_v1.proto import operations_pb2 as proto_operations_pb2
3838
from google.longrunning import operations_pb2 as longrunning_operations_pb2
39+
from google.protobuf import duration_pb2
3940
from google.protobuf import empty_pb2
4041
from google.protobuf import field_mask_pb2
4142

@@ -46,7 +47,7 @@
4647
class 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)

dataproc/google/cloud/dataproc_v1/gapic/cluster_controller_client_config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"methods": {
2020
"CreateCluster": {
21-
"timeout_millis": 90000,
21+
"timeout_millis": 30000,
2222
"retry_codes_name": "non_idempotent",
2323
"retry_params_name": "default"
2424
},
@@ -28,22 +28,22 @@
2828
"retry_params_name": "default"
2929
},
3030
"DeleteCluster": {
31-
"timeout_millis": 15000,
31+
"timeout_millis": 60000,
3232
"retry_codes_name": "idempotent",
3333
"retry_params_name": "default"
3434
},
3535
"GetCluster": {
36-
"timeout_millis": 10000,
36+
"timeout_millis": 60000,
3737
"retry_codes_name": "idempotent",
3838
"retry_params_name": "default"
3939
},
4040
"ListClusters": {
41-
"timeout_millis": 10000,
41+
"timeout_millis": 60000,
4242
"retry_codes_name": "idempotent",
4343
"retry_params_name": "default"
4444
},
4545
"DiagnoseCluster": {
46-
"timeout_millis": 10000,
46+
"timeout_millis": 60000,
4747
"retry_codes_name": "non_idempotent",
4848
"retry_params_name": "default"
4949
}

0 commit comments

Comments
 (0)