Removes a tag from a resource.
Parameters:
-
resource_arn
(ImageBuilderArn)
–
The Amazon Resource Name (ARN) of the resource that you want to untag.
-
tag_keys
(TagKeyList)
–
The tag keys to remove from the resource.
Raises:
-
InvalidParameterException
–
The specified parameter is invalid. Review the available parameters for the API request.
-
ResourceNotFoundException
–
At least one of the resources referenced by your request does not exist.
-
ServiceException
–
An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
Remove a tag from a resource
The following example removes the CostCenter tag key from the specified component build version.
>>> client.untag_resource(resource_arn='arn:aws:imagebuilder:us-west-2:111122223333:component/my-example-tagged-component/1.0.0/1', tag_keys=['CostCenter'])
Source code in docs_src/capo_imagebuilder/_services/imagebuilder.py
| def untag_resource(
self,
resource_arn: "capo_imagebuilder.types.image_builder_arn.ImageBuilderArn",
tag_keys: "capo_imagebuilder.types.tag_key_list.TagKeyList",
*,
config_overrides: Optional[imagebuilderClientConfig] = None,
) -> "capo_imagebuilder.types.untag_resource_response.UntagResourceResponse":
"""<p>Removes a tag from a resource.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the resource that you want to untag.</p>
tag_keys: <p>The tag keys to remove from the resource.</p>
Raises:
capo_imagebuilder.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
capo_imagebuilder.errors.resource_not_found_exception.ResourceNotFoundException: <p>At least one of the resources referenced by your request does not exist.</p>
capo_imagebuilder.errors.service_exception.ServiceException: <p>An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.</p>
capo_imagebuilder.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Remove a tag from a resource
The following example removes the CostCenter tag key from the specified component build version.
>>> client.untag_resource(resource_arn='arn:aws:imagebuilder:us-west-2:111122223333:component/my-example-tagged-component/1.0.0/1', tag_keys=['CostCenter'])
"""
def _handler(
req: "OperationRequest[capo_imagebuilder.types.untag_resource_request.UntagResourceRequest]",
) -> OperationResponse[
"capo_imagebuilder.types.untag_resource_response.UntagResourceResponse"
]:
import capo_imagebuilder._operations.imagebuilder.untag_resource
output, http_response = (
capo_imagebuilder._operations.imagebuilder.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_imagebuilder.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
|