Skip to content

list_migration_tasks async

list_migration_tasks(
    *,
    config_overrides: Optional[AsyncMigrationHubClientConfig] = None,
    next_token: Optional[Token] = None,
    max_results: Optional[MaxResults] = None,
    resource_name: Optional[ResourceName] = None,
) -> ListMigrationTasksResult

Lists all, or filtered by resource name, migration tasks associated with the user account making this call. This API has the following traits:

  • Can show a summary list of the most recent migration tasks.

  • Can show a summary list of migration tasks associated with a given discovered resource.

  • Lists migration tasks in a paginated interface.

Parameters:

  • next_token (Optional[Token], default: None ) –

    If a NextToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in NextToken.

  • max_results (Optional[MaxResults], default: None ) –

    Value to specify how many results are returned per page.

  • resource_name (Optional[ResourceName], default: None ) –

    Filter migration tasks by discovered resource name.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

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

  • PolicyErrorException –

    Exception raised when there are problems accessing Application Discovery Service (Application Discovery Service); most likely due to a misconfigured policy or the migrationhub-discovery role is missing or not configured correctly.

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

  • UnknownServiceError –

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

Source code in docs_src/capo_migration_hub/_services/async_migration_hub.py
async def list_migration_tasks(
    self,
    *,
    config_overrides: Optional[AsyncMigrationHubClientConfig] = None,
    next_token: Optional["capo_migration_hub.types.token.Token"] = None,
    max_results: Optional["capo_migration_hub.types.max_results.MaxResults"] = None,
    resource_name: Optional[
        "capo_migration_hub.types.resource_name.ResourceName"
    ] = None,
) -> (
    "capo_migration_hub.types.list_migration_tasks_result.ListMigrationTasksResult"
):
    """<p>Lists all, or filtered by resource name, migration tasks associated with the user account making this call. This API has the following traits:</p> <ul> <li> <p>Can show a summary list of the most recent migration tasks.</p> </li> <li> <p>Can show a summary list of migration tasks associated with a given discovered resource.</p> </li> <li> <p>Lists migration tasks in a paginated interface.</p> </li> </ul>

    Args:
        next_token: <p>If a <code>NextToken</code> was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in <code>NextToken</code>.</p>
        max_results: <p>Value to specify how many results are returned per page.</p>
        resource_name: <p>Filter migration tasks by discovered resource name.</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.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.policy_error_exception.PolicyErrorException: <p>Exception raised when there are problems accessing Application Discovery Service (Application Discovery Service); most likely due to a misconfigured policy or the <code>migrationhub-discovery</code> role is missing or not configured correctly.</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_migration_hub.types.list_migration_tasks_request.ListMigrationTasksRequest]",
    ) -> AsyncOperationResponse[
        "capo_migration_hub.types.list_migration_tasks_result.ListMigrationTasksResult"
    ]:
        import capo_migration_hub._operations.aws_migration_hub.list_migration_tasks

        (
            output,
            http_response,
        ) = await capo_migration_hub._operations.aws_migration_hub.list_migration_tasks.async_list_migration_tasks(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListMigrationTasks")
    )
    input_: capo_migration_hub.types.list_migration_tasks_request.ListMigrationTasksRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if resource_name is not None:
        input_["resource_name"] = resource_name

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output