Removes tags from an Amazon EMR resource, such as a cluster or Amazon EMR Studio. Tags make it easier to associate resources in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.
The following example removes the stack tag with value Prod from a cluster:
Parameters:
-
resource_id
(Optional[ResourceId], default:
None
)
–
The Amazon EMR resource identifier from which tags will be removed. For example, a cluster identifier or an Amazon EMR Studio ID.
-
tag_keys
(Optional[StringList], default:
None
)
–
A list of tag keys to remove from the resource.
-
cluster_id
(Optional[ClusterId], default:
None
)
–
The ID of the cluster that scopes the tag operation. Required when the resource being untagged is a session-scoped resource.
Raises:
Source code in docs_src/capo_emr/_services/emr.py
| def remove_tags(
self,
*,
config_overrides: Optional[EMRClientConfig] = None,
resource_id: Optional["capo_emr.types.resource_id.ResourceId"] = None,
tag_keys: Optional["capo_emr.types.string_list.StringList"] = None,
cluster_id: Optional["capo_emr.types.cluster_id.ClusterId"] = None,
) -> "capo_emr.types.remove_tags_output.RemoveTagsOutput":
"""<p>Removes tags from an Amazon EMR resource, such as a cluster or Amazon EMR Studio. Tags make it easier to associate resources in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see <a href="https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-tags.html">Tag Clusters</a>. </p> <p>The following example removes the stack tag with value Prod from a cluster:</p>
Args:
resource_id: <p>The Amazon EMR resource identifier from which tags will be removed. For example, a cluster identifier or an Amazon EMR Studio ID.</p>
tag_keys: <p>A list of tag keys to remove from the resource.</p>
cluster_id: <p>The ID of the cluster that scopes the tag operation. Required when the resource being untagged is a session-scoped resource.</p>
Raises:
capo_emr.errors.internal_server_exception.InternalServerException: <p>This exception occurs when there is an internal failure in the Amazon EMR service.</p>
capo_emr.errors.invalid_request_exception.InvalidRequestException: <p>This exception occurs when there is something wrong with user input.</p>
capo_emr.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_emr.types.remove_tags_input.RemoveTagsInput]",
) -> OperationResponse["capo_emr.types.remove_tags_output.RemoveTagsOutput"]:
import capo_emr._operations.elastic_map_reduce.remove_tags
output, http_response = (
capo_emr._operations.elastic_map_reduce.remove_tags.remove_tags(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("RemoveTags")
)
input_: capo_emr.types.remove_tags_input.RemoveTagsInput = {}
if resource_id is not None:
input_["resource_id"] = resource_id
if tag_keys is not None:
input_["tag_keys"] = tag_keys
if cluster_id is not None:
input_["cluster_id"] = cluster_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|