Removes a tag or list of tags from a resource.
Parameters:
-
resource_arn
(str)
–
The Amazon Resource Name (ARN) associated with the resource you want to remove the tag from.
-
tag_keys
(StringList)
–
A list of key names of tags to be removed.
Raises:
Examples:
Removing tags from a deployment parameter
The following example demonstrates removing two tags from a deployment parameter. For each, both the tag and the associated value are removed. There is no output from this API.
>>> client.untag_resource(resource_arn='arn:aws:aws-marketplace:us-east-1:123456789012:DeploymentParameter:catalogs/AWSMarketplace/products/product-1234/dp-uniqueidentifier', tag_keys=['FooKey', 'HelloKey'])
Source code in docs_src/capo_marketplace_deployment/_services/marketplace_deployment.py
| def untag_resource(
self,
resource_arn: str,
tag_keys: "capo_marketplace_deployment.types.string_list.StringList",
*,
config_overrides: Optional[MarketplaceDeploymentClientConfig] = None,
) -> "capo_marketplace_deployment.types.untag_resource_response.UntagResourceResponse":
"""<p>Removes a tag or list of tags from a resource.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) associated with the resource you want to remove the tag from.</p>
tag_keys: <p>A list of key names of tags to be removed.</p>
Raises:
capo_marketplace_deployment.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_marketplace_deployment.errors.conflict_exception.ConflictException: <p>The request configuration has conflicts. For details, see the accompanying error message.</p>
capo_marketplace_deployment.errors.internal_server_exception.InternalServerException: <p>There was an internal service exception.</p>
capo_marketplace_deployment.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource wasn't found.</p>
capo_marketplace_deployment.errors.throttling_exception.ThrottlingException: <p>Too many requests.</p>
capo_marketplace_deployment.errors.validation_exception.ValidationException: <p>An error occurred during validation.</p>
capo_marketplace_deployment.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Removing tags from a deployment parameter
The following example demonstrates removing two tags from a deployment parameter. For each, both the tag and the associated value are removed. There is no output from this API.
>>> client.untag_resource(resource_arn='arn:aws:aws-marketplace:us-east-1:123456789012:DeploymentParameter:catalogs/AWSMarketplace/products/product-1234/dp-uniqueidentifier', tag_keys=['FooKey', 'HelloKey'])
"""
def _handler(
req: "OperationRequest[capo_marketplace_deployment.types.untag_resource_request.UntagResourceRequest]",
) -> OperationResponse[
"capo_marketplace_deployment.types.untag_resource_response.UntagResourceResponse"
]:
import capo_marketplace_deployment._operations.awsmp_deployment_parameters_service.untag_resource
output, http_response = (
capo_marketplace_deployment._operations.awsmp_deployment_parameters_service.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_marketplace_deployment.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
|