Skip to content

start_import_task async

start_import_task(
    name: ImportTaskName,
    import_url: ImportURL,
    *,
    config_overrides: Optional[AsyncApplicationDiscoveryServiceClientConfig] = None,
    client_request_token: Optional[ClientRequestToken] = None,
) -> StartImportTaskResponse

Starts an import task, which allows you to import details of your on-premises environment directly into Amazon Web Services Migration Hub without having to use the Amazon Web Services Application Discovery Service (Application Discovery Service) tools such as the Amazon Web Services Application Discovery Service Agentless Collector or Application Discovery Agent. This gives you the option to perform migration assessment and planning directly from your imported data, including the ability to group your devices as applications and track their migration status.

To start an import request, do this:

  1. Download the specially formatted comma separated value (CSV) import template, which you can find here: https://s3.us-west-2.amazonaws.com/templates-7cffcf56-bd96-4b1c-b45b-a5b42f282e46/import_template.csv.

  2. Fill out the template with your server and application data.

  3. Upload your import file to an Amazon S3 bucket, and make a note of it's Object URL. Your import file must be in the CSV format.

  4. Use the console or the StartImportTask command with the Amazon Web Services CLI or one of the Amazon Web Services SDKs to import the records from your file.

For more information, including step-by-step procedures, see Migration Hub Import in the Amazon Web Services Application Discovery Service User Guide.

There are limits to the number of import tasks you can create (and delete) in an Amazon Web Services account. For more information, see Amazon Web Services Application Discovery Service Limits in the Amazon Web Services Application Discovery Service User Guide.

Parameters:

  • client_request_token (Optional[ClientRequestToken], default: None ) –

    Optional. A unique token that you can provide to prevent the same import request from occurring more than once. If you don't provide a token, a token is automatically generated.

    Sending more than one StartImportTask request with the same client request token will return information about the original import task with that client request token.

  • name (ImportTaskName) –

    A descriptive name for this request. You can use this name to filter future requests related to this import task, such as identifying applications and servers that were included in this import task. We recommend that you use a meaningful name for each import task.

  • import_url (ImportURL) –

    The URL for your import file that you've uploaded to Amazon S3.

    If you're using the Amazon Web Services CLI, this URL is structured as follows: s3://BucketName/ImportFileName.CSV

Raises:

  • AuthorizationErrorException –

    The user does not have permission to perform the action. Check the IAM policy associated with this user.

  • HomeRegionNotSetException –

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

  • InvalidParameterException –

    One or more parameters are not valid. Verify the parameters and try again.

  • InvalidParameterValueException –

    The value of one or more parameters are either invalid or out of range. Verify the parameter values and try again.

  • ResourceInUseException –

    This issue occurs when the same clientRequestToken is used with the StartImportTask action, but with different parameters. For example, you use the same request token but have two different import URLs, you can encounter this issue. If the import tasks are meant to be different, use a different clientRequestToken, and try again.

  • ServerInternalErrorException –

    The server experienced an internal error. Try again.

  • UnknownServiceError –

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

Source code in docs_src/capo_application_discovery_service/_services/async_application_discovery_service.py
async def start_import_task(
    self,
    name: "capo_application_discovery_service.types.import_task_name.ImportTaskName",
    import_url: "capo_application_discovery_service.types.import_url.ImportURL",
    *,
    config_overrides: Optional[AsyncApplicationDiscoveryServiceClientConfig] = None,
    client_request_token: Optional[
        "capo_application_discovery_service.types.client_request_token.ClientRequestToken"
    ] = None,
) -> "capo_application_discovery_service.types.start_import_task_response.StartImportTaskResponse":
    """<p>Starts an import task, which allows you to import details of your on-premises environment directly into Amazon Web Services Migration Hub without having to use the Amazon Web Services Application Discovery Service (Application Discovery Service) tools such as the Amazon Web Services Application Discovery Service Agentless Collector or Application Discovery Agent. This gives you the option to perform migration assessment and planning directly from your imported data, including the ability to group your devices as applications and track their migration status.</p> <p>To start an import request, do this:</p> <ol> <li> <p>Download the specially formatted comma separated value (CSV) import template, which you can find here: <a href="https://s3.us-west-2.amazonaws.com/templates-7cffcf56-bd96-4b1c-b45b-a5b42f282e46/import_template.csv">https://s3.us-west-2.amazonaws.com/templates-7cffcf56-bd96-4b1c-b45b-a5b42f282e46/import_template.csv</a>.</p> </li> <li> <p>Fill out the template with your server and application data.</p> </li> <li> <p>Upload your import file to an Amazon S3 bucket, and make a note of it's Object URL. Your import file must be in the CSV format.</p> </li> <li> <p>Use the console or the <code>StartImportTask</code> command with the Amazon Web Services CLI or one of the Amazon Web Services SDKs to import the records from your file.</p> </li> </ol> <p>For more information, including step-by-step procedures, see <a href="https://docs.aws.amazon.com/application-discovery/latest/userguide/discovery-import.html">Migration Hub Import</a> in the <i>Amazon Web Services Application Discovery Service User Guide</i>.</p> <note> <p>There are limits to the number of import tasks you can create (and delete) in an Amazon Web Services account. For more information, see <a href="https://docs.aws.amazon.com/application-discovery/latest/userguide/ads_service_limits.html">Amazon Web Services Application Discovery Service Limits</a> in the <i>Amazon Web Services Application Discovery Service User Guide</i>.</p> </note>

    Args:
        client_request_token: <p>Optional. A unique token that you can provide to prevent the same import request from occurring more than once. If you don't provide a token, a token is automatically generated.</p> <p>Sending more than one <code>StartImportTask</code> request with the same client request token will return information about the original import task with that client request token.</p>
        name: <p>A descriptive name for this request. You can use this name to filter future requests related to this import task, such as identifying applications and servers that were included in this import task. We recommend that you use a meaningful name for each import task.</p>
        import_url: <p>The URL for your import file that you've uploaded to Amazon S3.</p> <note> <p>If you're using the Amazon Web Services CLI, this URL is structured as follows: <code>s3://BucketName/ImportFileName.CSV</code> </p> </note>

    Raises:
        capo_application_discovery_service.errors.authorization_error_exception.AuthorizationErrorException: <p>The user does not have permission to perform the action. Check the IAM policy associated with this user.</p>
        capo_application_discovery_service.errors.home_region_not_set_exception.HomeRegionNotSetException: <p>The home Region is not set. Set the home Region to continue.</p>
        capo_application_discovery_service.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters are not valid. Verify the parameters and try again.</p>
        capo_application_discovery_service.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value of one or more parameters are either invalid or out of range. Verify the parameter values and try again.</p>
        capo_application_discovery_service.errors.resource_in_use_exception.ResourceInUseException: <p>This issue occurs when the same <code>clientRequestToken</code> is used with the <code>StartImportTask</code> action, but with different parameters. For example, you use the same request token but have two different import URLs, you can encounter this issue. If the import tasks are meant to be different, use a different <code>clientRequestToken</code>, and try again.</p>
        capo_application_discovery_service.errors.server_internal_error_exception.ServerInternalErrorException: <p>The server experienced an internal error. Try again.</p>
        capo_application_discovery_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_application_discovery_service.types.start_import_task_request.StartImportTaskRequest]",
    ) -> AsyncOperationResponse[
        "capo_application_discovery_service.types.start_import_task_response.StartImportTaskResponse"
    ]:
        import capo_application_discovery_service._operations.aws_poseidon_service_v2015_11_01.start_import_task

        (
            output,
            http_response,
        ) = await capo_application_discovery_service._operations.aws_poseidon_service_v2015_11_01.start_import_task.async_start_import_task(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartImportTask")
    )
    input_: capo_application_discovery_service.types.start_import_task_request.StartImportTaskRequest = {
        "name": name,
        "import_url": import_url,
    }
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token

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