Removes tags from a resource.
Parameters:
-
resource_arn
(Arn)
–
The Amazon Resource Name (ARN) for the resource to remove tags from.
-
tag_keys
(TagKeyList)
–
The tag keys to remove from the resource.
Raises:
Source code in docs_src/capo_inspector2/_services/inspector2.py
| def untag_resource(
self,
resource_arn: "capo_inspector2.types.arn.Arn",
tag_keys: "capo_inspector2.types.tag_key_list.TagKeyList",
*,
config_overrides: Optional[Inspector2ClientConfig] = None,
) -> "capo_inspector2.types.untag_resource_response.UntagResourceResponse":
"""<p>Removes tags from a resource.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) for the resource to remove tags from.</p>
tag_keys: <p>The tag keys to remove from the resource.</p>
Raises:
capo_inspector2.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal failure of the Amazon Inspector service.</p>
capo_inspector2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access an invalid resource. Make sure the resource is specified correctly.</p>
capo_inspector2.errors.throttling_exception.ThrottlingException: <p>The limit on the number of requests per second was exceeded.</p>
capo_inspector2.errors.validation_exception.ValidationException: <p>The request has failed validation due to missing required fields or having invalid inputs.</p>
capo_inspector2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_inspector2.types.untag_resource_request.UntagResourceRequest]",
) -> OperationResponse[
"capo_inspector2.types.untag_resource_response.UntagResourceResponse"
]:
import capo_inspector2._operations.inspector2.untag_resource
output, http_response = (
capo_inspector2._operations.inspector2.untag_resource.untag_resource(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UntagResource")
)
input_: capo_inspector2.types.untag_resource_request.UntagResourceRequest = {
"resource_arn": resource_arn,
"tag_keys": tag_keys,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|