Skip to content

delete_tags

delete_tags(
    file_system_id: FileSystemId,
    tag_keys: TagKeys,
    *,
    config_overrides: Optional[EFSClientConfig] = None,
) -> None

DEPRECATED - DeleteTags is deprecated and not maintained. To remove tags from EFS resources, use the API action.

Deletes the specified tags from a file system. If the DeleteTags request includes a tag key that doesn't exist, Amazon EFS ignores it and doesn't cause an error. For more information about tags and related restrictions, see Tag restrictions in the Billing and Cost Management User Guide.

This operation requires permissions for the elasticfilesystem:DeleteTags action.

Parameters:

  • file_system_id (FileSystemId) –

    The ID of the file system whose tags you want to delete (String).

  • tag_keys (TagKeys) –

    A list of tag keys to delete.

Raises:

  • BadRequest –

    Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.

  • FileSystemNotFound –

    Returned if the specified FileSystemId value doesn't exist in the requester's Amazon Web Services account.

  • InternalServerError –

    Returned if an error occurred on the server side.

  • UnknownServiceError –

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

Examples:

To delete tags for an EFS file system This operation deletes tags for an EFS file system.

>>> client.delete_tags(file_system_id='fs-01234567', tag_keys=['Name'])
Source code in docs_src/capo_efs/_services/efs.py
def delete_tags(
    self,
    file_system_id: "capo_efs.types.file_system_id.FileSystemId",
    tag_keys: "capo_efs.types.tag_keys.TagKeys",
    *,
    config_overrides: Optional[EFSClientConfig] = None,
) -> None:
    """<note> <p>DEPRECATED - <code>DeleteTags</code> is deprecated and not maintained. To remove tags from EFS resources, use the API action.</p> </note> <p>Deletes the specified tags from a file system. If the <code>DeleteTags</code> request includes a tag key that doesn't exist, Amazon EFS ignores it and doesn't cause an error. For more information about tags and related restrictions, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html">Tag restrictions</a> in the <i>Billing and Cost Management User Guide</i>.</p> <p>This operation requires permissions for the <code>elasticfilesystem:DeleteTags</code> action.</p>

    Args:
        file_system_id: <p>The ID of the file system whose tags you want to delete (String).</p>
        tag_keys: <p>A list of tag keys to delete.</p>

    Raises:
        capo_efs.errors.bad_request.BadRequest: <p>Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.</p>
        capo_efs.errors.file_system_not_found.FileSystemNotFound: <p>Returned if the specified <code>FileSystemId</code> value doesn't exist in the requester's Amazon Web Services account.</p>
        capo_efs.errors.internal_server_error.InternalServerError: <p>Returned if an error occurred on the server side.</p>
        capo_efs.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To delete tags for an EFS file system
        This operation deletes tags for an EFS file system.

        >>> client.delete_tags(file_system_id='fs-01234567', tag_keys=['Name'])
    """

    def _handler(
        req: "OperationRequest[capo_efs.types.delete_tags_request.DeleteTagsRequest]",
    ) -> OperationResponse[None]:
        import capo_efs._operations.magnolio_api_service_v20150201.delete_tags

        output, http_response = (
            capo_efs._operations.magnolio_api_service_v20150201.delete_tags.delete_tags(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteTags")
    )
    input_: capo_efs.types.delete_tags_request.DeleteTagsRequest = {
        "file_system_id": file_system_id,
        "tag_keys": tag_keys,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output