Removes the specified tags from the given resource.
Parameters:
-
resource_arn
(Arn)
–
The ARN of the resource to remove tags from. The ARN must not include a :DRAFT qualifier.
-
tag_keys
(TagKeyList)
–
The keys of the tags to remove from the resource.
Raises:
-
AccessDeniedException
–
You do not have sufficient permissions to perform this action.
-
InternalServerException
–
The request processing failed because of an internal error in the service. This is a retryable error.
-
ResourceNotFoundException
–
The specified resource was not found. Verify that the resource identifier is correct and that the resource exists, then try your request again.
-
TagPolicyViolationException
–
The request violates a tag policy that is in effect for the account or organization.
-
ThrottlingException
–
The request was denied because of request throttling. Reduce your request rate and try again.
-
ValidationException
–
The request failed validation. For details, see the reason and fieldList members of the response.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
Remove tags from a resource
Removes the specified tag keys from a Network Security Manager resource.
>>> await client.untag_resource(resource_arn='arn:aws:network-security-manager:us-east-1:123456789012:policy:xyz789', tag_keys=['Environment'])
Source code in docs_src/capo_network_security_manager/_services/async_network_security_manager.py
| async def untag_resource(
self,
resource_arn: "capo_network_security_manager.types.arn.Arn",
tag_keys: "capo_network_security_manager.types.tag_key_list.TagKeyList",
*,
config_overrides: Optional[AsyncNetworkSecurityManagerClientConfig] = None,
) -> (
"capo_network_security_manager.types.untag_resource_output.UntagResourceOutput"
):
"""<p>Removes the specified tags from the given resource.</p>
Args:
resource_arn: <p>The ARN of the resource to remove tags from. The ARN must not include a <code>:DRAFT</code> qualifier.</p>
tag_keys: <p>The keys of the tags to remove from the resource.</p>
Raises:
capo_network_security_manager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
capo_network_security_manager.errors.internal_server_exception.InternalServerException: <p>The request processing failed because of an internal error in the service. This is a retryable error.</p>
capo_network_security_manager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify that the resource identifier is correct and that the resource exists, then try your request again.</p>
capo_network_security_manager.errors.tag_policy_violation_exception.TagPolicyViolationException: <p>The request violates a tag policy that is in effect for the account or organization.</p>
capo_network_security_manager.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling. Reduce your request rate and try again.</p>
capo_network_security_manager.errors.validation_exception.ValidationException: <p>The request failed validation. For details, see the <code>reason</code> and <code>fieldList</code> members of the response.</p>
capo_network_security_manager.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Remove tags from a resource
Removes the specified tag keys from a Network Security Manager resource.
>>> await client.untag_resource(resource_arn='arn:aws:network-security-manager:us-east-1:123456789012:policy:xyz789', tag_keys=['Environment'])
"""
async def _handler(
req: "AsyncOperationRequest[capo_network_security_manager.types.untag_resource_input.UntagResourceInput]",
) -> AsyncOperationResponse[
"capo_network_security_manager.types.untag_resource_output.UntagResourceOutput"
]:
import capo_network_security_manager._operations.piccolo_customer_api_service.untag_resource
(
output,
http_response,
) = await capo_network_security_manager._operations.piccolo_customer_api_service.untag_resource.async_untag_resource(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UntagResource")
)
input_: capo_network_security_manager.types.untag_resource_input.UntagResourceInput = {
"resource_arn": resource_arn,
"tag_keys": tag_keys,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|