Skip to content

update_file_cache async

update_file_cache(
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    file_cache_id: Optional[FileCacheId] = None,
    client_request_token: Optional[ClientRequestToken] = None,
    lustre_configuration: Optional[UpdateFileCacheLustreConfiguration] = None,
) -> UpdateFileCacheResponse

Updates the configuration of an existing Amazon File Cache resource. You can update multiple properties in a single request.

Parameters:

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.

  • MissingFileCacheConfiguration –

    A cache configuration is required for this operation.

  • ServiceLimitExceeded –

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

  • UnsupportedOperation –

    The requested operation is not supported for this resource or API.

  • UnknownServiceError –

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

Source code in docs_src/capo_fsx/_services/async_f_sx.py
async def update_file_cache(
    self,
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = 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,
    lustre_configuration: Optional[
        "capo_fsx.types.update_file_cache_lustre_configuration.UpdateFileCacheLustreConfiguration"
    ] = None,
) -> "capo_fsx.types.update_file_cache_response.UpdateFileCacheResponse":
    """<p>Updates the configuration of an existing Amazon File Cache resource. You can update multiple properties in a single request.</p>

    Args:
        file_cache_id: <p>The ID of the cache that you are updating.</p>
        lustre_configuration: <p>The configuration updates for an Amazon File Cache resource.</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.missing_file_cache_configuration.MissingFileCacheConfiguration: <p>A cache configuration is required for this operation.</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.unsupported_operation.UnsupportedOperation: <p>The requested operation is not supported for this resource or API.</p>
        capo_fsx.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_fsx.types.update_file_cache_request.UpdateFileCacheRequest]",
    ) -> AsyncOperationResponse[
        "capo_fsx.types.update_file_cache_response.UpdateFileCacheResponse"
    ]:
        import capo_fsx._operations.aws_simba_api_service_v20180301.update_file_cache

        (
            output,
            http_response,
        ) = await capo_fsx._operations.aws_simba_api_service_v20180301.update_file_cache.async_update_file_cache(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateFileCache")
    )
    input_: capo_fsx.types.update_file_cache_request.UpdateFileCacheRequest = {}
    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
    if lustre_configuration is not None:
        input_["lustre_configuration"] = lustre_configuration

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output