Skip to content

delete_file_cache

delete_file_cache(
    *,
    config_overrides: Optional[FSxClientConfig] = None,
    file_cache_id: Optional[FileCacheId] = None,
    client_request_token: Optional[ClientRequestToken] = None,
) -> DeleteFileCacheResponse

Deletes an Amazon File Cache resource. After deletion, the cache no longer exists, and its data is gone.

The DeleteFileCache operation returns while the cache has the DELETING status. You can check the cache deletion status by calling the DescribeFileCaches operation, which returns a list of caches in your account. If you pass the cache ID for a deleted cache, the DescribeFileCaches operation returns a FileCacheNotFound error.

The data in a deleted cache is also deleted and can't be recovered by any means.

Parameters:

  • file_cache_id (Optional[FileCacheId], default: None ) –

    The ID of the cache that's being deleted.

Raises:

  • BadRequest –

    A generic error indicating a failure with a client request.

  • FileCacheNotFound –

    No caches were found based upon supplied parameters.

  • IncompatibleParameterError –

    The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.

  • InternalServerError –

    A generic error indicating a server-side failure.

  • ServiceLimitExceeded –

    An error indicating that a particular service limit was exceeded. You can increase some service limits by contacting Amazon Web Services Support.

  • UnknownServiceError –

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

Source code in docs_src/capo_fsx/_services/f_sx.py
def delete_file_cache(
    self,
    *,
    config_overrides: Optional[FSxClientConfig] = None,
    file_cache_id: Optional["capo_fsx.types.file_cache_id.FileCacheId"] = None,
    client_request_token: Optional[
        "capo_fsx.types.client_request_token.ClientRequestToken"
    ] = None,
) -> "capo_fsx.types.delete_file_cache_response.DeleteFileCacheResponse":
    """<p>Deletes an Amazon File Cache resource. After deletion, the cache no longer exists, and its data is gone.</p> <p>The <code>DeleteFileCache</code> operation returns while the cache has the <code>DELETING</code> status. You can check the cache deletion status by calling the <a href="https://docs.aws.amazon.com/fsx/latest/APIReference/API_DescribeFileCaches.html">DescribeFileCaches</a> operation, which returns a list of caches in your account. If you pass the cache ID for a deleted cache, the <code>DescribeFileCaches</code> operation returns a <code>FileCacheNotFound</code> error.</p> <important> <p>The data in a deleted cache is also deleted and can't be recovered by any means.</p> </important>

    Args:
        file_cache_id: <p>The ID of the cache that's being deleted.</p>

    Raises:
        capo_fsx.errors.bad_request.BadRequest: <p>A generic error indicating a failure with a client request.</p>
        capo_fsx.errors.file_cache_not_found.FileCacheNotFound: <p>No caches were found based upon supplied parameters.</p>
        capo_fsx.errors.incompatible_parameter_error.IncompatibleParameterError: <p>The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.</p>
        capo_fsx.errors.internal_server_error.InternalServerError: <p>A generic error indicating a server-side failure.</p>
        capo_fsx.errors.service_limit_exceeded.ServiceLimitExceeded: <p>An error indicating that a particular service limit was exceeded. You can increase some service limits by contacting Amazon Web Services Support.</p>
        capo_fsx.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_fsx.types.delete_file_cache_request.DeleteFileCacheRequest]",
    ) -> OperationResponse[
        "capo_fsx.types.delete_file_cache_response.DeleteFileCacheResponse"
    ]:
        import capo_fsx._operations.aws_simba_api_service_v20180301.delete_file_cache

        output, http_response = (
            capo_fsx._operations.aws_simba_api_service_v20180301.delete_file_cache.delete_file_cache(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteFileCache")
    )
    input_: capo_fsx.types.delete_file_cache_request.DeleteFileCacheRequest = {}
    if file_cache_id is not None:
        input_["file_cache_id"] = file_cache_id
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token

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