Cancels an active import task and stops importing data from the CloudTrail Lake Event Data Store.
Parameters:
-
import_id
(ImportId)
–
The ID of the import task to cancel.
Raises:
Source code in docs_src/capo_cloudwatch_logs/_services/cloud_watch_logs.py
| def cancel_import_task(
self,
import_id: "capo_cloudwatch_logs.types.import_id.ImportId",
*,
config_overrides: Optional[CloudWatchLogsClientConfig] = None,
) -> "capo_cloudwatch_logs.types.cancel_import_task_response.CancelImportTaskResponse":
"""<p>Cancels an active import task and stops importing data from the CloudTrail Lake Event Data Store.</p>
Args:
import_id: <p>The ID of the import task to cancel.</p>
Raises:
capo_cloudwatch_logs.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
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.throttling_exception.ThrottlingException: <p>The request was throttled because of quota limits.</p>
capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudwatch_logs.types.cancel_import_task_request.CancelImportTaskRequest]",
) -> OperationResponse[
"capo_cloudwatch_logs.types.cancel_import_task_response.CancelImportTaskResponse"
]:
import capo_cloudwatch_logs._operations.logs_20140328.cancel_import_task
output, http_response = (
capo_cloudwatch_logs._operations.logs_20140328.cancel_import_task.cancel_import_task(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CancelImportTask")
)
input_: capo_cloudwatch_logs.types.cancel_import_task_request.CancelImportTaskRequest = {
"import_id": import_id
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|