Skip to content

start_task_execution

start_task_execution(
    task_arn: TaskArn,
    *,
    config_overrides: Optional[DataSyncClientConfig] = None,
    override_options: Optional[Options] = None,
    includes: Optional[FilterList] = None,
    excludes: Optional[FilterList] = None,
    manifest_config: Optional[ManifestConfig] = None,
    task_report_config: Optional[TaskReportConfig] = None,
    tags: Optional[InputTagList] = None,
) -> StartTaskExecutionResponse

Starts an DataSync transfer task. For each task, you can only run one task execution at a time.

There are several steps to a task execution. For more information, see Task execution statuses.

If you're planning to transfer data to or from an Amazon S3 location, review how DataSync can affect your S3 request charges and the DataSync pricing page before you begin.

Parameters:

  • task_arn (TaskArn) –

    Specifies the Amazon Resource Name (ARN) of the task that you want to start.

  • includes (Optional[FilterList], default: None ) –

    Specifies a list of filter rules that determines which files to include when running a task. The pattern should contain a single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a pipe), for example, "/folder1|/folder2".

  • excludes (Optional[FilterList], default: None ) –

    Specifies a list of filter rules that determines which files to exclude from a task. The list contains a single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for example, "/folder1|/folder2".

  • manifest_config (Optional[ManifestConfig], default: None ) –

    Configures a manifest, which is a list of files or objects that you want DataSync to transfer. For more information and configuration examples, see Specifying what DataSync transfers by using a manifest.

    When using this parameter, your caller identity (the role that you're using DataSync with) must have the iam:PassRole permission. The AWSDataSyncFullAccess policy includes this permission.

    To remove a manifest configuration, specify this parameter with an empty value.

  • task_report_config (Optional[TaskReportConfig], default: None ) –

    Specifies how you want to configure a task report, which provides detailed information about your DataSync transfer. For more information, see Monitoring your DataSync transfers with task reports.

    When using this parameter, your caller identity (the role that you're using DataSync with) must have the iam:PassRole permission. The AWSDataSyncFullAccess policy includes this permission.

    To remove a task report configuration, specify this parameter as empty.

  • tags (Optional[InputTagList], default: None ) –

    Specifies the tags that you want to apply to the Amazon Resource Name (ARN) representing the task execution.

    Tags are key-value pairs that help you manage, filter, and search for your DataSync resources.

Raises:

Source code in docs_src/capo_datasync/_services/data_sync.py
def start_task_execution(
    self,
    task_arn: "capo_datasync.types.task_arn.TaskArn",
    *,
    config_overrides: Optional[DataSyncClientConfig] = None,
    override_options: Optional["capo_datasync.types.options.Options"] = None,
    includes: Optional["capo_datasync.types.filter_list.FilterList"] = None,
    excludes: Optional["capo_datasync.types.filter_list.FilterList"] = None,
    manifest_config: Optional[
        "capo_datasync.types.manifest_config.ManifestConfig"
    ] = None,
    task_report_config: Optional[
        "capo_datasync.types.task_report_config.TaskReportConfig"
    ] = None,
    tags: Optional["capo_datasync.types.input_tag_list.InputTagList"] = None,
) -> "capo_datasync.types.start_task_execution_response.StartTaskExecutionResponse":
    """<p>Starts an DataSync transfer task. For each task, you can only run one task execution at a time.</p> <p>There are several steps to a task execution. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/working-with-task-executions.html#understand-task-execution-statuses">Task execution statuses</a>.</p> <important> <p>If you're planning to transfer data to or from an Amazon S3 location, review <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#create-s3-location-s3-requests">how DataSync can affect your S3 request charges</a> and the <a href="http://aws.amazon.com/datasync/pricing/">DataSync pricing page</a> before you begin.</p> </important>

    Args:
        task_arn: <p>Specifies the Amazon Resource Name (ARN) of the task that you want to start.</p>
        includes: <p>Specifies a list of filter rules that determines which files to include when running a task. The pattern should contain a single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a pipe), for example, <code>"/folder1|/folder2"</code>. </p>
        excludes: <p>Specifies a list of filter rules that determines which files to exclude from a task. The list contains a single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for example, <code>"/folder1|/folder2"</code>. </p>
        manifest_config: <p>Configures a manifest, which is a list of files or objects that you want DataSync to transfer. For more information and configuration examples, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/transferring-with-manifest.html">Specifying what DataSync transfers by using a manifest</a>.</p> <p>When using this parameter, your caller identity (the role that you're using DataSync with) must have the <code>iam:PassRole</code> permission. The <a href="https://docs.aws.amazon.com/datasync/latest/userguide/security-iam-awsmanpol.html#security-iam-awsmanpol-awsdatasyncfullaccess">AWSDataSyncFullAccess</a> policy includes this permission.</p> <p>To remove a manifest configuration, specify this parameter with an empty value.</p>
        task_report_config: <p>Specifies how you want to configure a task report, which provides detailed information about your DataSync transfer. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/task-reports.html">Monitoring your DataSync transfers with task reports</a>.</p> <p>When using this parameter, your caller identity (the role that you're using DataSync with) must have the <code>iam:PassRole</code> permission. The <a href="https://docs.aws.amazon.com/datasync/latest/userguide/security-iam-awsmanpol.html#security-iam-awsmanpol-awsdatasyncfullaccess">AWSDataSyncFullAccess</a> policy includes this permission.</p> <p>To remove a task report configuration, specify this parameter as empty.</p>
        tags: <p>Specifies the tags that you want to apply to the Amazon Resource Name (ARN) representing the task execution.</p> <p> <i>Tags</i> are key-value pairs that help you manage, filter, and search for your DataSync resources.</p>

    Raises:
        capo_datasync.errors.internal_exception.InternalException: <p>This exception is thrown when an error occurs in the DataSync service.</p>
        capo_datasync.errors.invalid_request_exception.InvalidRequestException: <p>This exception is thrown when the client submits a malformed request.</p>
        capo_datasync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_datasync.types.start_task_execution_request.StartTaskExecutionRequest]",
    ) -> OperationResponse[
        "capo_datasync.types.start_task_execution_response.StartTaskExecutionResponse"
    ]:
        import capo_datasync._operations.fmrs_service.start_task_execution

        output, http_response = (
            capo_datasync._operations.fmrs_service.start_task_execution.start_task_execution(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartTaskExecution")
    )
    input_: capo_datasync.types.start_task_execution_request.StartTaskExecutionRequest = {
        "task_arn": task_arn
    }
    if override_options is not None:
        input_["override_options"] = override_options
    if includes is not None:
        input_["includes"] = includes
    if excludes is not None:
        input_["excludes"] = excludes
    if manifest_config is not None:
        input_["manifest_config"] = manifest_config
    if task_report_config is not None:
        input_["task_report_config"] = task_report_config
    if tags is not None:
        input_["tags"] = tags

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