Cancels the specified export task.
The task must be in the PENDING or RUNNING state.
Parameters:
Raises:
Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
| async def cancel_export_task(
self,
task_id: "capo_cloudwatch_logs.types.export_task_id.ExportTaskId",
*,
config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> None:
"""<p>Cancels the specified export task.</p> <p>The task must be in the <code>PENDING</code> or <code>RUNNING</code> state.</p>
Args:
task_id: <p>The ID of the export task.</p>
Raises:
capo_cloudwatch_logs.errors.invalid_operation_exception.InvalidOperationException: <p>The operation is not valid on the specified resource.</p>
capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_cloudwatch_logs.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service cannot complete the request.</p>
capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudwatch_logs.types.cancel_export_task_request.CancelExportTaskRequest]",
) -> AsyncOperationResponse[None]:
import capo_cloudwatch_logs._operations.logs_20140328.cancel_export_task
(
output,
http_response,
) = await capo_cloudwatch_logs._operations.logs_20140328.cancel_export_task.async_cancel_export_task(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CancelExportTask")
)
input_: capo_cloudwatch_logs.types.cancel_export_task_request.CancelExportTaskRequest = {
"task_id": task_id
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|