Deletes the specified tags.
Parameters:
Raises:
-
ResourceContentionFault
–
You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).
-
ResourceInUseFault
–
The operation can't be performed because the resource is in use.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To delete a tag from an Auto Scaling group
This example deletes the specified tag from the specified Auto Scaling group.
>>> client.delete_tags(tags=[{'ResourceId': 'my-auto-scaling-group', 'ResourceType': 'auto-scaling-group', 'Key': 'Dept', 'Value': 'Research'}])
Source code in docs_src/capo_auto_scaling/_services/auto_scaling.py
| def delete_tags(
self,
*,
config_overrides: Optional[AutoScalingClientConfig] = None,
tags: Optional["capo_auto_scaling.types.tags.Tags"] = None,
) -> None:
"""<p>Deletes the specified tags.</p>
Args:
tags: <p>One or more tags.</p>
Raises:
capo_auto_scaling.errors.resource_contention_fault.ResourceContentionFault: <p>You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).</p>
capo_auto_scaling.errors.resource_in_use_fault.ResourceInUseFault: <p>The operation can't be performed because the resource is in use.</p>
capo_auto_scaling.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To delete a tag from an Auto Scaling group
This example deletes the specified tag from the specified Auto Scaling group.
>>> client.delete_tags(tags=[{'ResourceId': 'my-auto-scaling-group', 'ResourceType': 'auto-scaling-group', 'Key': 'Dept', 'Value': 'Research'}])
"""
def _handler(
req: "OperationRequest[capo_auto_scaling.types.delete_tags_type.DeleteTagsType]",
) -> OperationResponse[None]:
import capo_auto_scaling._operations.auto_scaling_2011_01_01.delete_tags
output, http_response = (
capo_auto_scaling._operations.auto_scaling_2011_01_01.delete_tags.delete_tags(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteTags")
)
input_: capo_auto_scaling.types.delete_tags_type.DeleteTagsType = {}
if tags is not None:
input_["tags"] = tags
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|