EMR: Rename get_cluster to describe_cluster (#4504)
This commit is contained in:
parent
e1298e334b
commit
13f985115b
3
.gitignore
vendored
3
.gitignore
vendored
@ -24,4 +24,5 @@ tests/file.tmp
|
|||||||
*.tmp
|
*.tmp
|
||||||
.venv/
|
.venv/
|
||||||
htmlcov/
|
htmlcov/
|
||||||
.~c9_*
|
.~c9_*
|
||||||
|
.coverage*
|
||||||
|
@ -1858,7 +1858,7 @@
|
|||||||
|
|
||||||
## emr
|
## emr
|
||||||
<details>
|
<details>
|
||||||
<summary>40% implemented</summary>
|
<summary>42% implemented</summary>
|
||||||
|
|
||||||
- [ ] add_instance_fleet
|
- [ ] add_instance_fleet
|
||||||
- [X] add_instance_groups
|
- [X] add_instance_groups
|
||||||
@ -1871,7 +1871,7 @@
|
|||||||
- [X] delete_security_configuration
|
- [X] delete_security_configuration
|
||||||
- [ ] delete_studio
|
- [ ] delete_studio
|
||||||
- [ ] delete_studio_session_mapping
|
- [ ] delete_studio_session_mapping
|
||||||
- [ ] describe_cluster
|
- [X] describe_cluster
|
||||||
- [X] describe_job_flows
|
- [X] describe_job_flows
|
||||||
- [ ] describe_notebook_execution
|
- [ ] describe_notebook_execution
|
||||||
- [ ] describe_release_label
|
- [ ] describe_release_label
|
||||||
|
@ -414,7 +414,7 @@ class ElasticMapReduceBackend(BaseBackend):
|
|||||||
return ec2_backends[self.region_name]
|
return ec2_backends[self.region_name]
|
||||||
|
|
||||||
def add_applications(self, cluster_id, applications):
|
def add_applications(self, cluster_id, applications):
|
||||||
cluster = self.get_cluster(cluster_id)
|
cluster = self.describe_cluster(cluster_id)
|
||||||
cluster.add_applications(applications)
|
cluster.add_applications(applications)
|
||||||
|
|
||||||
def add_instance_groups(self, cluster_id, instance_groups):
|
def add_instance_groups(self, cluster_id, instance_groups):
|
||||||
@ -444,7 +444,7 @@ class ElasticMapReduceBackend(BaseBackend):
|
|||||||
return steps
|
return steps
|
||||||
|
|
||||||
def add_tags(self, cluster_id, tags):
|
def add_tags(self, cluster_id, tags):
|
||||||
cluster = self.get_cluster(cluster_id)
|
cluster = self.describe_cluster(cluster_id)
|
||||||
cluster.add_tags(tags)
|
cluster.add_tags(tags)
|
||||||
|
|
||||||
def describe_job_flows(
|
def describe_job_flows(
|
||||||
@ -479,7 +479,7 @@ class ElasticMapReduceBackend(BaseBackend):
|
|||||||
if step.id == step_id:
|
if step.id == step_id:
|
||||||
return step
|
return step
|
||||||
|
|
||||||
def get_cluster(self, cluster_id):
|
def describe_cluster(self, cluster_id):
|
||||||
if cluster_id in self.clusters:
|
if cluster_id in self.clusters:
|
||||||
return self.clusters[cluster_id]
|
return self.clusters[cluster_id]
|
||||||
raise EmrError("ResourceNotFoundException", "", "error_json")
|
raise EmrError("ResourceNotFoundException", "", "error_json")
|
||||||
@ -578,7 +578,7 @@ class ElasticMapReduceBackend(BaseBackend):
|
|||||||
return result_groups
|
return result_groups
|
||||||
|
|
||||||
def remove_tags(self, cluster_id, tag_keys):
|
def remove_tags(self, cluster_id, tag_keys):
|
||||||
cluster = self.get_cluster(cluster_id)
|
cluster = self.describe_cluster(cluster_id)
|
||||||
cluster.remove_tags(tag_keys)
|
cluster.remove_tags(tag_keys)
|
||||||
|
|
||||||
def _manage_security_groups(
|
def _manage_security_groups(
|
||||||
|
@ -128,7 +128,7 @@ class ElasticMapReduceResponse(BaseResponse):
|
|||||||
@generate_boto3_response("DescribeCluster")
|
@generate_boto3_response("DescribeCluster")
|
||||||
def describe_cluster(self):
|
def describe_cluster(self):
|
||||||
cluster_id = self._get_param("ClusterId")
|
cluster_id = self._get_param("ClusterId")
|
||||||
cluster = self.backend.get_cluster(cluster_id)
|
cluster = self.backend.describe_cluster(cluster_id)
|
||||||
template = self.response_template(DESCRIBE_CLUSTER_TEMPLATE)
|
template = self.response_template(DESCRIBE_CLUSTER_TEMPLATE)
|
||||||
return template.render(cluster=cluster)
|
return template.render(cluster=cluster)
|
||||||
|
|
||||||
@ -528,7 +528,7 @@ class ElasticMapReduceResponse(BaseResponse):
|
|||||||
@generate_boto3_response("PutAutoScalingPolicy")
|
@generate_boto3_response("PutAutoScalingPolicy")
|
||||||
def put_auto_scaling_policy(self):
|
def put_auto_scaling_policy(self):
|
||||||
cluster_id = self._get_param("ClusterId")
|
cluster_id = self._get_param("ClusterId")
|
||||||
cluster = self.backend.get_cluster(cluster_id)
|
cluster = self.backend.describe_cluster(cluster_id)
|
||||||
instance_group_id = self._get_param("InstanceGroupId")
|
instance_group_id = self._get_param("InstanceGroupId")
|
||||||
auto_scaling_policy = self._get_param("AutoScalingPolicy")
|
auto_scaling_policy = self._get_param("AutoScalingPolicy")
|
||||||
instance_group = self.backend.put_auto_scaling_policy(
|
instance_group = self.backend.put_auto_scaling_policy(
|
||||||
|
Loading…
Reference in New Issue
Block a user