Skip to content

notify_migration_task_state

notify_migration_task_state(
    progress_update_stream: ProgressUpdateStream,
    migration_task_name: MigrationTaskName,
    task: Task,
    update_date_time: UpdateDateTime,
    next_update_seconds: NextUpdateSeconds,
    *,
    config_overrides: Optional[MigrationHubClientConfig] = None,
    dry_run: Optional[DryRun] = None,
) -> NotifyMigrationTaskStateResult

Notifies Migration Hub of the current status, progress, or other detail regarding a migration task. This API has the following traits:

  • Migration tools will call the NotifyMigrationTaskState API to share the latest progress and status.

  • MigrationTaskName is used for addressing updates to the correct target.

  • ProgressUpdateStream is used for access control and to provide a namespace for each migration tool.

Parameters:

  • progress_update_stream (ProgressUpdateStream) –

    The name of the ProgressUpdateStream.

  • migration_task_name (MigrationTaskName) –

    Unique identifier that references the migration task. Do not store personal data in this field.

  • task (Task) –

    Information about the task's progress and status.

  • update_date_time (UpdateDateTime) –

    The timestamp when the task was gathered.

  • next_update_seconds (NextUpdateSeconds) –

    Number of seconds after the UpdateDateTime within which the Migration Hub can expect an update. If Migration Hub does not receive an update within the specified interval, then the migration task will be considered stale.

  • dry_run (Optional[DryRun], default: None ) –

    Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • DryRunOperation –

    Exception raised to indicate a successfully authorized action when the DryRun flag is set to "true".

  • HomeRegionNotSetException –

    The home region is not set. Set the home region to continue.

  • InternalServerError –

    Exception raised when an internal, configuration, or dependency error is encountered.

  • InvalidInputException –

    Exception raised when the provided input violates a policy constraint or is entered in the wrong format or data type.

  • ResourceNotFoundException –

    Exception raised when the request references a resource (Application Discovery Service configuration, update stream, migration task, etc.) that does not exist in Application Discovery Service (Application Discovery Service) or in Migration Hub's repository.

  • ServiceUnavailableException –

    Exception raised when there is an internal, configuration, or dependency error encountered.

  • ThrottlingException –

    The request was denied due to request throttling.

  • UnauthorizedOperation –

    Exception raised to indicate a request was not authorized when the DryRun flag is set to "true".

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_migration_hub/_services/migration_hub.py
def notify_migration_task_state(
    self,
    progress_update_stream: "capo_migration_hub.types.progress_update_stream.ProgressUpdateStream",
    migration_task_name: "capo_migration_hub.types.migration_task_name.MigrationTaskName",
    task: "capo_migration_hub.types.task.Task",
    update_date_time: "capo_migration_hub.types.update_date_time.UpdateDateTime",
    next_update_seconds: "capo_migration_hub.types.next_update_seconds.NextUpdateSeconds",
    *,
    config_overrides: Optional[MigrationHubClientConfig] = None,
    dry_run: Optional["capo_migration_hub.types.dry_run.DryRun"] = None,
) -> "capo_migration_hub.types.notify_migration_task_state_result.NotifyMigrationTaskStateResult":
    """<p>Notifies Migration Hub of the current status, progress, or other detail regarding a migration task. This API has the following traits:</p> <ul> <li> <p>Migration tools will call the <code>NotifyMigrationTaskState</code> API to share the latest progress and status.</p> </li> <li> <p> <code>MigrationTaskName</code> is used for addressing updates to the correct target.</p> </li> <li> <p> <code>ProgressUpdateStream</code> is used for access control and to provide a namespace for each migration tool.</p> </li> </ul>

    Args:
        progress_update_stream: <p>The name of the ProgressUpdateStream. </p>
        migration_task_name: <p>Unique identifier that references the migration task. <i>Do not store personal data in this field.</i> </p>
        task: <p>Information about the task's progress and status.</p>
        update_date_time: <p>The timestamp when the task was gathered.</p>
        next_update_seconds: <p>Number of seconds after the UpdateDateTime within which the Migration Hub can expect an update. If Migration Hub does not receive an update within the specified interval, then the migration task will be considered stale.</p>
        dry_run: <p>Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.</p>

    Raises:
        capo_migration_hub.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_migration_hub.errors.dry_run_operation.DryRunOperation: <p>Exception raised to indicate a successfully authorized action when the <code>DryRun</code> flag is set to "true".</p>
        capo_migration_hub.errors.home_region_not_set_exception.HomeRegionNotSetException: <p>The home region is not set. Set the home region to continue.</p>
        capo_migration_hub.errors.internal_server_error.InternalServerError: <p>Exception raised when an internal, configuration, or dependency error is encountered.</p>
        capo_migration_hub.errors.invalid_input_exception.InvalidInputException: <p>Exception raised when the provided input violates a policy constraint or is entered in the wrong format or data type.</p>
        capo_migration_hub.errors.resource_not_found_exception.ResourceNotFoundException: <p>Exception raised when the request references a resource (Application Discovery Service configuration, update stream, migration task, etc.) that does not exist in Application Discovery Service (Application Discovery Service) or in Migration Hub's repository.</p>
        capo_migration_hub.errors.service_unavailable_exception.ServiceUnavailableException: <p>Exception raised when there is an internal, configuration, or dependency error encountered.</p>
        capo_migration_hub.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_migration_hub.errors.unauthorized_operation.UnauthorizedOperation: <p>Exception raised to indicate a request was not authorized when the <code>DryRun</code> flag is set to "true".</p>
        capo_migration_hub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_migration_hub.types.notify_migration_task_state_request.NotifyMigrationTaskStateRequest]",
    ) -> OperationResponse[
        "capo_migration_hub.types.notify_migration_task_state_result.NotifyMigrationTaskStateResult"
    ]:
        import capo_migration_hub._operations.aws_migration_hub.notify_migration_task_state

        output, http_response = (
            capo_migration_hub._operations.aws_migration_hub.notify_migration_task_state.notify_migration_task_state(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("NotifyMigrationTaskState")
    )
    input_: capo_migration_hub.types.notify_migration_task_state_request.NotifyMigrationTaskStateRequest = {
        "progress_update_stream": progress_update_stream,
        "migration_task_name": migration_task_name,
        "task": task,
        "update_date_time": update_date_time,
        "next_update_seconds": next_update_seconds,
    }
    if dry_run is not None:
        input_["dry_run"] = dry_run

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