Cancels an existing Amazon FSx for Lustre data repository task if that task is in either the PENDING or EXECUTING state. When you cancel an export task, Amazon FSx does the following.
-
Any files that FSx has already exported are not reverted.
-
FSx continues to export any files that are in-flight when the cancel operation is received.
-
FSx does not export any files that have not yet been exported.
For a release task, Amazon FSx will stop releasing files upon cancellation. Any files that have already been released will remain in the released state.
Parameters:
-
task_id
(Optional[TaskId], default:
None
)
–
Specifies the data repository task to cancel.
Raises:
Source code in docs_src/capo_fsx/_services/f_sx.py
| def cancel_data_repository_task(
self,
*,
config_overrides: Optional[FSxClientConfig] = None,
task_id: Optional["capo_fsx.types.task_id.TaskId"] = None,
) -> "capo_fsx.types.cancel_data_repository_task_response.CancelDataRepositoryTaskResponse":
"""<p>Cancels an existing Amazon FSx for Lustre data repository task if that task is in either the <code>PENDING</code> or <code>EXECUTING</code> state. When you cancel an export task, Amazon FSx does the following.</p> <ul> <li> <p>Any files that FSx has already exported are not reverted.</p> </li> <li> <p>FSx continues to export any files that are in-flight when the cancel operation is received.</p> </li> <li> <p>FSx does not export any files that have not yet been exported.</p> </li> </ul> <p>For a release task, Amazon FSx will stop releasing files upon cancellation. Any files that have already been released will remain in the released state.</p>
Args:
task_id: <p>Specifies the data repository task to cancel.</p>
Raises:
capo_fsx.errors.bad_request.BadRequest: <p>A generic error indicating a failure with a client request.</p>
capo_fsx.errors.data_repository_task_ended.DataRepositoryTaskEnded: <p>The data repository task could not be canceled because the task has already ended.</p>
capo_fsx.errors.data_repository_task_not_found.DataRepositoryTaskNotFound: <p>The data repository task or tasks you specified could not be found.</p>
capo_fsx.errors.internal_server_error.InternalServerError: <p>A generic error indicating a server-side failure.</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.
"""
def _handler(
req: "OperationRequest[capo_fsx.types.cancel_data_repository_task_request.CancelDataRepositoryTaskRequest]",
) -> OperationResponse[
"capo_fsx.types.cancel_data_repository_task_response.CancelDataRepositoryTaskResponse"
]:
import capo_fsx._operations.aws_simba_api_service_v20180301.cancel_data_repository_task
output, http_response = (
capo_fsx._operations.aws_simba_api_service_v20180301.cancel_data_repository_task.cancel_data_repository_task(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CancelDataRepositoryTask")
)
input_: capo_fsx.types.cancel_data_repository_task_request.CancelDataRepositoryTaskRequest = {}
if task_id is not None:
input_["task_id"] = task_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|