Skip to content

update_task

update_task(
    task_arn: TaskArn,
    *,
    config_overrides: Optional[DataSyncClientConfig] = None,
    options: Optional[Options] = None,
    excludes: Optional[FilterList] = None,
    schedule: Optional[TaskSchedule] = None,
    name: Optional[TagValue] = None,
    cloud_watch_log_group_arn: Optional[LogGroupArn] = None,
    includes: Optional[FilterList] = None,
    manifest_config: Optional[ManifestConfig] = None,
    task_report_config: Optional[TaskReportConfig] = None,
) -> UpdateTaskResponse

Updates the configuration of a task, which defines where and how DataSync transfers your data.

Parameters:

  • task_arn (TaskArn) –

    Specifies the ARN of the task that you want to update.

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

    Specifies exclude filters that define the files, objects, and folders in your source location that you don't want DataSync to transfer. For more information and examples, see Specifying what DataSync transfers by using filters.

  • schedule (Optional[TaskSchedule], default: None ) –

    Specifies a schedule for when you want your task to run. For more information, see Scheduling your task.

  • name (Optional[TagValue], default: None ) –

    Specifies the name of your task.

  • cloud_watch_log_group_arn (Optional[LogGroupArn], default: None ) –

    Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task.

    For Enhanced mode tasks, you must use /aws/datasync as your log group name. For example:

    arn:aws:logs:us-east-1:111222333444:log-group:/aws/datasync:*

    For more information, see Monitoring data transfers with CloudWatch Logs.

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

    Specifies include filters define the files, objects, and folders in your source location that you want DataSync to transfer. For more information and examples, see Specifying what DataSync transfers by using filters.

  • 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 IAM 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 as empty.

  • 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 IAM 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.

Raises:

Source code in docs_src/capo_datasync/_services/data_sync.py
def update_task(
    self,
    task_arn: "capo_datasync.types.task_arn.TaskArn",
    *,
    config_overrides: Optional[DataSyncClientConfig] = None,
    options: Optional["capo_datasync.types.options.Options"] = None,
    excludes: Optional["capo_datasync.types.filter_list.FilterList"] = None,
    schedule: Optional["capo_datasync.types.task_schedule.TaskSchedule"] = None,
    name: Optional["capo_datasync.types.tag_value.TagValue"] = None,
    cloud_watch_log_group_arn: Optional[
        "capo_datasync.types.log_group_arn.LogGroupArn"
    ] = None,
    includes: 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,
) -> "capo_datasync.types.update_task_response.UpdateTaskResponse":
    """<p>Updates the configuration of a <i>task</i>, which defines where and how DataSync transfers your data.</p>

    Args:
        task_arn: <p>Specifies the ARN of the task that you want to update.</p>
        excludes: <p>Specifies exclude filters that define the files, objects, and folders in your source location that you don't want DataSync to transfer. For more information and examples, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html">Specifying what DataSync transfers by using filters</a>.</p>
        schedule: <p>Specifies a schedule for when you want your task to run. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/task-scheduling.html">Scheduling your task</a>.</p>
        name: <p>Specifies the name of your task.</p>
        cloud_watch_log_group_arn: <p>Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task.</p> <p>For Enhanced mode tasks, you must use <code>/aws/datasync</code> as your log group name. For example:</p> <p> <code>arn:aws:logs:us-east-1:111222333444:log-group:/aws/datasync:*</code> </p> <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/configure-logging.html">Monitoring data transfers with CloudWatch Logs</a>.</p>
        includes: <p>Specifies include filters define the files, objects, and folders in your source location that you want DataSync to transfer. For more information and examples, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/filtering.html">Specifying what DataSync transfers by using filters</a>.</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 IAM 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 as empty.</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 IAM 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>

    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.update_task_request.UpdateTaskRequest]",
    ) -> OperationResponse[
        "capo_datasync.types.update_task_response.UpdateTaskResponse"
    ]:
        import capo_datasync._operations.fmrs_service.update_task

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTask")
    )
    input_: capo_datasync.types.update_task_request.UpdateTaskRequest = {
        "task_arn": task_arn
    }
    if options is not None:
        input_["options"] = options
    if excludes is not None:
        input_["excludes"] = excludes
    if schedule is not None:
        input_["schedule"] = schedule
    if name is not None:
        input_["name"] = name
    if cloud_watch_log_group_arn is not None:
        input_["cloud_watch_log_group_arn"] = cloud_watch_log_group_arn
    if includes is not None:
        input_["includes"] = includes
    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

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