Skip to content

untag_resource

untag_resource(
    resource_arn: Arn,
    tag_keys: TagKeyList,
    *,
    config_overrides: Optional[ECRPUBLICClientConfig] = None,
) -> UntagResourceResponse

Deletes specified tags from a resource.

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Name (ARN) of the resource to delete tags from. Currently, the supported resource is an Amazon ECR Public repository.

  • tag_keys (TagKeyList) –

    The keys of the tags to be removed.

Raises:

  • InvalidParameterException –

    The specified parameter is invalid. Review the available parameters for the API request.

  • InvalidTagParameterException –

    An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

  • RepositoryNotFoundException –

    The specified repository can't be found. Check the spelling of the specified repository and ensure that you're performing operations on the correct registry.

  • ServerException –

    These errors are usually caused by a server-side issue.

  • TooManyTagsException –

    The list of tags on the repository is over the limit. The maximum number of tags that can be applied to a repository is 50.

  • UnsupportedCommandException –

    The action isn't supported in this Region.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_ecr_public/_services/ecrpublic.py
def untag_resource(
    self,
    resource_arn: "capo_ecr_public.types.arn.Arn",
    tag_keys: "capo_ecr_public.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[ECRPUBLICClientConfig] = None,
) -> "capo_ecr_public.types.untag_resource_response.UntagResourceResponse":
    """<p>Deletes specified tags from a resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource to delete tags from. Currently, the supported resource is an Amazon ECR Public repository.</p>
        tag_keys: <p>The keys of the tags to be removed.</p>

    Raises:
        capo_ecr_public.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
        capo_ecr_public.errors.invalid_tag_parameter_exception.InvalidTagParameterException: <p>An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
        capo_ecr_public.errors.repository_not_found_exception.RepositoryNotFoundException: <p>The specified repository can't be found. Check the spelling of the specified repository and ensure that you're performing operations on the correct registry.</p>
        capo_ecr_public.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
        capo_ecr_public.errors.too_many_tags_exception.TooManyTagsException: <p>The list of tags on the repository is over the limit. The maximum number of tags that can be applied to a repository is 50.</p>
        capo_ecr_public.errors.unsupported_command_exception.UnsupportedCommandException: <p>The action isn't supported in this Region.</p>
        capo_ecr_public.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ecr_public.types.untag_resource_request.UntagResourceRequest]",
    ) -> OperationResponse[
        "capo_ecr_public.types.untag_resource_response.UntagResourceResponse"
    ]:
        import capo_ecr_public._operations.spencer_frontend_service.untag_resource

        output, http_response = (
            capo_ecr_public._operations.spencer_frontend_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_ecr_public.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