|
4 | 4 |
|
5 | 5 | import logging |
6 | 6 | from dataclasses import dataclass |
7 | | -from datetime import timedelta |
8 | 7 | from enum import Enum |
9 | 8 | from typing import Any, Dict, Iterator, List, Optional |
10 | 9 |
|
@@ -10307,76 +10306,6 @@ def create( |
10307 | 10306 | cluster_id=op_response["cluster_id"], |
10308 | 10307 | ) |
10309 | 10308 |
|
10310 | | - def create_and_wait( |
10311 | | - self, |
10312 | | - spark_version: str, |
10313 | | - *, |
10314 | | - apply_policy_default_values: Optional[bool] = None, |
10315 | | - autoscale: Optional[AutoScale] = None, |
10316 | | - autotermination_minutes: Optional[int] = None, |
10317 | | - aws_attributes: Optional[AwsAttributes] = None, |
10318 | | - azure_attributes: Optional[AzureAttributes] = None, |
10319 | | - clone_from: Optional[CloneCluster] = None, |
10320 | | - cluster_log_conf: Optional[ClusterLogConf] = None, |
10321 | | - cluster_name: Optional[str] = None, |
10322 | | - custom_tags: Optional[Dict[str, str]] = None, |
10323 | | - data_security_mode: Optional[DataSecurityMode] = None, |
10324 | | - docker_image: Optional[DockerImage] = None, |
10325 | | - driver_instance_pool_id: Optional[str] = None, |
10326 | | - driver_node_type_id: Optional[str] = None, |
10327 | | - enable_elastic_disk: Optional[bool] = None, |
10328 | | - enable_local_disk_encryption: Optional[bool] = None, |
10329 | | - gcp_attributes: Optional[GcpAttributes] = None, |
10330 | | - init_scripts: Optional[List[InitScriptInfo]] = None, |
10331 | | - instance_pool_id: Optional[str] = None, |
10332 | | - is_single_node: Optional[bool] = None, |
10333 | | - kind: Optional[Kind] = None, |
10334 | | - node_type_id: Optional[str] = None, |
10335 | | - num_workers: Optional[int] = None, |
10336 | | - policy_id: Optional[str] = None, |
10337 | | - runtime_engine: Optional[RuntimeEngine] = None, |
10338 | | - single_user_name: Optional[str] = None, |
10339 | | - spark_conf: Optional[Dict[str, str]] = None, |
10340 | | - spark_env_vars: Optional[Dict[str, str]] = None, |
10341 | | - ssh_public_keys: Optional[List[str]] = None, |
10342 | | - use_ml_runtime: Optional[bool] = None, |
10343 | | - workload_type: Optional[WorkloadType] = None, |
10344 | | - timeout=timedelta(minutes=20), |
10345 | | - ) -> ClusterDetails: |
10346 | | - return self.create( |
10347 | | - apply_policy_default_values=apply_policy_default_values, |
10348 | | - autoscale=autoscale, |
10349 | | - autotermination_minutes=autotermination_minutes, |
10350 | | - aws_attributes=aws_attributes, |
10351 | | - azure_attributes=azure_attributes, |
10352 | | - clone_from=clone_from, |
10353 | | - cluster_log_conf=cluster_log_conf, |
10354 | | - cluster_name=cluster_name, |
10355 | | - custom_tags=custom_tags, |
10356 | | - data_security_mode=data_security_mode, |
10357 | | - docker_image=docker_image, |
10358 | | - driver_instance_pool_id=driver_instance_pool_id, |
10359 | | - driver_node_type_id=driver_node_type_id, |
10360 | | - enable_elastic_disk=enable_elastic_disk, |
10361 | | - enable_local_disk_encryption=enable_local_disk_encryption, |
10362 | | - gcp_attributes=gcp_attributes, |
10363 | | - init_scripts=init_scripts, |
10364 | | - instance_pool_id=instance_pool_id, |
10365 | | - is_single_node=is_single_node, |
10366 | | - kind=kind, |
10367 | | - node_type_id=node_type_id, |
10368 | | - num_workers=num_workers, |
10369 | | - policy_id=policy_id, |
10370 | | - runtime_engine=runtime_engine, |
10371 | | - single_user_name=single_user_name, |
10372 | | - spark_conf=spark_conf, |
10373 | | - spark_env_vars=spark_env_vars, |
10374 | | - spark_version=spark_version, |
10375 | | - ssh_public_keys=ssh_public_keys, |
10376 | | - use_ml_runtime=use_ml_runtime, |
10377 | | - workload_type=workload_type, |
10378 | | - ).result(timeout=timeout) |
10379 | | - |
10380 | 10309 | def delete(self, cluster_id: str) -> Wait[ClusterDetails]: |
10381 | 10310 | """Terminate cluster. |
10382 | 10311 |
|
@@ -10404,9 +10333,6 @@ def delete(self, cluster_id: str) -> Wait[ClusterDetails]: |
10404 | 10333 | self.WaitGetClusterTerminated, response=DeleteClusterResponse.from_dict(op_response), cluster_id=cluster_id |
10405 | 10334 | ) |
10406 | 10335 |
|
10407 | | - def delete_and_wait(self, cluster_id: str, timeout=timedelta(minutes=20)) -> ClusterDetails: |
10408 | | - return self.delete(cluster_id=cluster_id).result(timeout=timeout) |
10409 | | - |
10410 | 10336 | def edit( |
10411 | 10337 | self, |
10412 | 10338 | cluster_id: str, |
@@ -10695,76 +10621,6 @@ def edit( |
10695 | 10621 | self.WaitGetClusterRunning, response=EditClusterResponse.from_dict(op_response), cluster_id=cluster_id |
10696 | 10622 | ) |
10697 | 10623 |
|
10698 | | - def edit_and_wait( |
10699 | | - self, |
10700 | | - cluster_id: str, |
10701 | | - spark_version: str, |
10702 | | - *, |
10703 | | - apply_policy_default_values: Optional[bool] = None, |
10704 | | - autoscale: Optional[AutoScale] = None, |
10705 | | - autotermination_minutes: Optional[int] = None, |
10706 | | - aws_attributes: Optional[AwsAttributes] = None, |
10707 | | - azure_attributes: Optional[AzureAttributes] = None, |
10708 | | - cluster_log_conf: Optional[ClusterLogConf] = None, |
10709 | | - cluster_name: Optional[str] = None, |
10710 | | - custom_tags: Optional[Dict[str, str]] = None, |
10711 | | - data_security_mode: Optional[DataSecurityMode] = None, |
10712 | | - docker_image: Optional[DockerImage] = None, |
10713 | | - driver_instance_pool_id: Optional[str] = None, |
10714 | | - driver_node_type_id: Optional[str] = None, |
10715 | | - enable_elastic_disk: Optional[bool] = None, |
10716 | | - enable_local_disk_encryption: Optional[bool] = None, |
10717 | | - gcp_attributes: Optional[GcpAttributes] = None, |
10718 | | - init_scripts: Optional[List[InitScriptInfo]] = None, |
10719 | | - instance_pool_id: Optional[str] = None, |
10720 | | - is_single_node: Optional[bool] = None, |
10721 | | - kind: Optional[Kind] = None, |
10722 | | - node_type_id: Optional[str] = None, |
10723 | | - num_workers: Optional[int] = None, |
10724 | | - policy_id: Optional[str] = None, |
10725 | | - runtime_engine: Optional[RuntimeEngine] = None, |
10726 | | - single_user_name: Optional[str] = None, |
10727 | | - spark_conf: Optional[Dict[str, str]] = None, |
10728 | | - spark_env_vars: Optional[Dict[str, str]] = None, |
10729 | | - ssh_public_keys: Optional[List[str]] = None, |
10730 | | - use_ml_runtime: Optional[bool] = None, |
10731 | | - workload_type: Optional[WorkloadType] = None, |
10732 | | - timeout=timedelta(minutes=20), |
10733 | | - ) -> ClusterDetails: |
10734 | | - return self.edit( |
10735 | | - apply_policy_default_values=apply_policy_default_values, |
10736 | | - autoscale=autoscale, |
10737 | | - autotermination_minutes=autotermination_minutes, |
10738 | | - aws_attributes=aws_attributes, |
10739 | | - azure_attributes=azure_attributes, |
10740 | | - cluster_id=cluster_id, |
10741 | | - cluster_log_conf=cluster_log_conf, |
10742 | | - cluster_name=cluster_name, |
10743 | | - custom_tags=custom_tags, |
10744 | | - data_security_mode=data_security_mode, |
10745 | | - docker_image=docker_image, |
10746 | | - driver_instance_pool_id=driver_instance_pool_id, |
10747 | | - driver_node_type_id=driver_node_type_id, |
10748 | | - enable_elastic_disk=enable_elastic_disk, |
10749 | | - enable_local_disk_encryption=enable_local_disk_encryption, |
10750 | | - gcp_attributes=gcp_attributes, |
10751 | | - init_scripts=init_scripts, |
10752 | | - instance_pool_id=instance_pool_id, |
10753 | | - is_single_node=is_single_node, |
10754 | | - kind=kind, |
10755 | | - node_type_id=node_type_id, |
10756 | | - num_workers=num_workers, |
10757 | | - policy_id=policy_id, |
10758 | | - runtime_engine=runtime_engine, |
10759 | | - single_user_name=single_user_name, |
10760 | | - spark_conf=spark_conf, |
10761 | | - spark_env_vars=spark_env_vars, |
10762 | | - spark_version=spark_version, |
10763 | | - ssh_public_keys=ssh_public_keys, |
10764 | | - use_ml_runtime=use_ml_runtime, |
10765 | | - workload_type=workload_type, |
10766 | | - ).result(timeout=timeout) |
10767 | | - |
10768 | 10624 | def events( |
10769 | 10625 | self, |
10770 | 10626 | cluster_id: str, |
@@ -11055,16 +10911,6 @@ def resize( |
11055 | 10911 | self.WaitGetClusterRunning, response=ResizeClusterResponse.from_dict(op_response), cluster_id=cluster_id |
11056 | 10912 | ) |
11057 | 10913 |
|
11058 | | - def resize_and_wait( |
11059 | | - self, |
11060 | | - cluster_id: str, |
11061 | | - *, |
11062 | | - autoscale: Optional[AutoScale] = None, |
11063 | | - num_workers: Optional[int] = None, |
11064 | | - timeout=timedelta(minutes=20), |
11065 | | - ) -> ClusterDetails: |
11066 | | - return self.resize(autoscale=autoscale, cluster_id=cluster_id, num_workers=num_workers).result(timeout=timeout) |
11067 | | - |
11068 | 10914 | def restart(self, cluster_id: str, *, restart_user: Optional[str] = None) -> Wait[ClusterDetails]: |
11069 | 10915 | """Restart cluster. |
11070 | 10916 |
|
@@ -11094,11 +10940,6 @@ def restart(self, cluster_id: str, *, restart_user: Optional[str] = None) -> Wai |
11094 | 10940 | self.WaitGetClusterRunning, response=RestartClusterResponse.from_dict(op_response), cluster_id=cluster_id |
11095 | 10941 | ) |
11096 | 10942 |
|
11097 | | - def restart_and_wait( |
11098 | | - self, cluster_id: str, *, restart_user: Optional[str] = None, timeout=timedelta(minutes=20) |
11099 | | - ) -> ClusterDetails: |
11100 | | - return self.restart(cluster_id=cluster_id, restart_user=restart_user).result(timeout=timeout) |
11101 | | - |
11102 | 10943 | def set_permissions( |
11103 | 10944 | self, cluster_id: str, *, access_control_list: Optional[List[ClusterAccessControlRequest]] = None |
11104 | 10945 | ) -> ClusterPermissions: |
@@ -11168,9 +11009,6 @@ def start(self, cluster_id: str) -> Wait[ClusterDetails]: |
11168 | 11009 | self.WaitGetClusterRunning, response=StartClusterResponse.from_dict(op_response), cluster_id=cluster_id |
11169 | 11010 | ) |
11170 | 11011 |
|
11171 | | - def start_and_wait(self, cluster_id: str, timeout=timedelta(minutes=20)) -> ClusterDetails: |
11172 | | - return self.start(cluster_id=cluster_id).result(timeout=timeout) |
11173 | | - |
11174 | 11012 | def unpin(self, cluster_id: str): |
11175 | 11013 | """Unpin cluster. |
11176 | 11014 |
|
@@ -11245,16 +11083,6 @@ def update( |
11245 | 11083 | self.WaitGetClusterRunning, response=UpdateClusterResponse.from_dict(op_response), cluster_id=cluster_id |
11246 | 11084 | ) |
11247 | 11085 |
|
11248 | | - def update_and_wait( |
11249 | | - self, |
11250 | | - cluster_id: str, |
11251 | | - update_mask: str, |
11252 | | - *, |
11253 | | - cluster: Optional[UpdateClusterResource] = None, |
11254 | | - timeout=timedelta(minutes=20), |
11255 | | - ) -> ClusterDetails: |
11256 | | - return self.update(cluster=cluster, cluster_id=cluster_id, update_mask=update_mask).result(timeout=timeout) |
11257 | | - |
11258 | 11086 | def update_permissions( |
11259 | 11087 | self, cluster_id: str, *, access_control_list: Optional[List[ClusterAccessControlRequest]] = None |
11260 | 11088 | ) -> ClusterPermissions: |
@@ -11325,16 +11153,6 @@ def cancel( |
11325 | 11153 | context_id=context_id, |
11326 | 11154 | ) |
11327 | 11155 |
|
11328 | | - def cancel_and_wait( |
11329 | | - self, |
11330 | | - *, |
11331 | | - cluster_id: Optional[str] = None, |
11332 | | - command_id: Optional[str] = None, |
11333 | | - context_id: Optional[str] = None, |
11334 | | - timeout=timedelta(minutes=20), |
11335 | | - ) -> CommandStatusResponse: |
11336 | | - return self.cancel(cluster_id=cluster_id, command_id=command_id, context_id=context_id).result(timeout=timeout) |
11337 | | - |
11338 | 11156 | def command_status(self, cluster_id: str, context_id: str, command_id: str) -> CommandStatusResponse: |
11339 | 11157 | """Get command info. |
11340 | 11158 |
|
@@ -11421,11 +11239,6 @@ def create( |
11421 | 11239 | context_id=op_response["id"], |
11422 | 11240 | ) |
11423 | 11241 |
|
11424 | | - def create_and_wait( |
11425 | | - self, *, cluster_id: Optional[str] = None, language: Optional[Language] = None, timeout=timedelta(minutes=20) |
11426 | | - ) -> ContextStatusResponse: |
11427 | | - return self.create(cluster_id=cluster_id, language=language).result(timeout=timeout) |
11428 | | - |
11429 | 11242 | def destroy(self, cluster_id: str, context_id: str): |
11430 | 11243 | """Delete an execution context. |
11431 | 11244 |
|
@@ -11497,19 +11310,6 @@ def execute( |
11497 | 11310 | context_id=context_id, |
11498 | 11311 | ) |
11499 | 11312 |
|
11500 | | - def execute_and_wait( |
11501 | | - self, |
11502 | | - *, |
11503 | | - cluster_id: Optional[str] = None, |
11504 | | - command: Optional[str] = None, |
11505 | | - context_id: Optional[str] = None, |
11506 | | - language: Optional[Language] = None, |
11507 | | - timeout=timedelta(minutes=20), |
11508 | | - ) -> CommandStatusResponse: |
11509 | | - return self.execute(cluster_id=cluster_id, command=command, context_id=context_id, language=language).result( |
11510 | | - timeout=timeout |
11511 | | - ) |
11512 | | - |
11513 | 11313 |
|
11514 | 11314 | class GlobalInitScriptsAPI: |
11515 | 11315 | """The Global Init Scripts API enables Workspace administrators to configure global initialization scripts |
|
0 commit comments