Removes one or more tags from the specified resource.
Parameters:
-
resource_arn
(AmazonResourceName)
–
The Amazon Resource Name (ARN) of the resource that you want to retrieve tags for.
-
tag_keys
(TagKeyList)
–
The tag keys to remove from the specified resource.
Raises:
-
InvalidInput
–
One or more specified values aren't valid. For example, a required value might be missing, a numeric value might be outside the allowed range, or a string value might exceed length constraints.
-
ResourceNotFoundException
–
The operation can't be completed because the resource was not found.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
UntagResource example
This example removes the "Department" and "Project" tags from a resource.
>>> await client.untag_resource(resource_arn='arn:aws:servicediscovery:us-east-1:123456789012:namespace/ns-ylexjili4cdxy3xm', tag_keys=['Project', 'Department'])
Source code in docs_src/capo_servicediscovery/_services/async_service_discovery.py
| async def untag_resource(
self,
resource_arn: "capo_servicediscovery.types.amazon_resource_name.AmazonResourceName",
tag_keys: "capo_servicediscovery.types.tag_key_list.TagKeyList",
*,
config_overrides: Optional[AsyncServiceDiscoveryClientConfig] = None,
) -> "capo_servicediscovery.types.untag_resource_response.UntagResourceResponse":
"""<p>Removes one or more tags from the specified resource.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the resource that you want to retrieve tags for.</p>
tag_keys: <p>The tag keys to remove from the specified resource.</p>
Raises:
capo_servicediscovery.errors.invalid_input.InvalidInput: <p>One or more specified values aren't valid. For example, a required value might be missing, a numeric value might be outside the allowed range, or a string value might exceed length constraints.</p>
capo_servicediscovery.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation can't be completed because the resource was not found.</p>
capo_servicediscovery.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
UntagResource example
This example removes the "Department" and "Project" tags from a resource.
>>> await client.untag_resource(resource_arn='arn:aws:servicediscovery:us-east-1:123456789012:namespace/ns-ylexjili4cdxy3xm', tag_keys=['Project', 'Department'])
"""
async def _handler(
req: "AsyncOperationRequest[capo_servicediscovery.types.untag_resource_request.UntagResourceRequest]",
) -> AsyncOperationResponse[
"capo_servicediscovery.types.untag_resource_response.UntagResourceResponse"
]:
import capo_servicediscovery._operations.route53_auto_naming_v20170314.untag_resource
(
output,
http_response,
) = await capo_servicediscovery._operations.route53_auto_naming_v20170314.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_servicediscovery.types.untag_resource_request.UntagResourceRequest = {
"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
|