Skip to content

start_import_file_task async

start_import_file_task(
    name: String,
    s3_bucket: importS3Bucket,
    s3key: String,
    *,
    config_overrides: Optional[AsyncMigrationHubStrategyClientConfig] = None,
    data_source_type: Optional[DataSourceType] = None,
    group_id: Optional[GroupIds] = None,
    s3bucket_for_report_data: Optional[String] = None,
) -> StartImportFileTaskResponse

Starts a file import.

Parameters:

  • name (String) –

    A descriptive name for the request.

  • s3_bucket (importS3Bucket) –

    The S3 bucket where the import file is located. The bucket name is required to begin with migrationhub-strategy-.

  • s3key (String) –

    The Amazon S3 key name of the import file.

  • data_source_type (Optional[DataSourceType], default: None ) –

    Specifies the source that the servers are coming from. By default, Strategy Recommendations assumes that the servers specified in the import file are available in AWS Application Discovery Service.

  • group_id (Optional[GroupIds], default: None ) –

    Groups the resources in the import file together with a unique name. This ID can be as filter in ListApplicationComponents and ListServers.

  • s3bucket_for_report_data (Optional[String], default: None ) –

    The S3 bucket where Strategy Recommendations uploads import results. The bucket name is required to begin with migrationhub-strategy-.

Raises:

Source code in docs_src/capo_migrationhubstrategy/_services/async_migration_hub_strategy.py
async def start_import_file_task(
    self,
    name: "capo_migrationhubstrategy.types.string.String",
    s3_bucket: "capo_migrationhubstrategy.types.import_s3_bucket.importS3Bucket",
    s3key: "capo_migrationhubstrategy.types.string.String",
    *,
    config_overrides: Optional[AsyncMigrationHubStrategyClientConfig] = None,
    data_source_type: Optional[
        "capo_migrationhubstrategy.types.data_source_type.DataSourceType"
    ] = None,
    group_id: Optional["capo_migrationhubstrategy.types.group_ids.GroupIds"] = None,
    s3bucket_for_report_data: Optional[
        "capo_migrationhubstrategy.types.string.String"
    ] = None,
) -> "capo_migrationhubstrategy.types.start_import_file_task_response.StartImportFileTaskResponse":
    """<p> Starts a file import. </p>

    Args:
        name: <p> A descriptive name for the request. </p>
        s3_bucket: <p> The S3 bucket where the import file is located. The bucket name is required to begin with <code>migrationhub-strategy-</code>.</p>
        s3key: <p> The Amazon S3 key name of the import file. </p>
        data_source_type: <p>Specifies the source that the servers are coming from. By default, Strategy Recommendations assumes that the servers specified in the import file are available in AWS Application Discovery Service. </p>
        group_id: <p>Groups the resources in the import file together with a unique name. This ID can be as filter in <code>ListApplicationComponents</code> and <code>ListServers</code>. </p>
        s3bucket_for_report_data: <p> The S3 bucket where Strategy Recommendations uploads import results. The bucket name is required to begin with migrationhub-strategy-. </p>

    Raises:
        capo_migrationhubstrategy.errors.access_denied_exception.AccessDeniedException: <p> The user does not have permission to perform the action. Check the AWS Identity and Access Management (IAM) policy associated with this user.</p>
        capo_migrationhubstrategy.errors.internal_server_exception.InternalServerException: <p> The server experienced an internal error. Try again. </p>
        capo_migrationhubstrategy.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p> The AWS account has reached its quota of imports. Contact AWS Support to increase the quota for this account. </p>
        capo_migrationhubstrategy.errors.throttling_exception.ThrottlingException: <p> The request was denied due to request throttling. </p>
        capo_migrationhubstrategy.errors.validation_exception.ValidationException: <p> The request body isn't valid. </p>
        capo_migrationhubstrategy.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_migrationhubstrategy.types.start_import_file_task_request.StartImportFileTaskRequest]",
    ) -> AsyncOperationResponse[
        "capo_migrationhubstrategy.types.start_import_file_task_response.StartImportFileTaskResponse"
    ]:
        import capo_migrationhubstrategy._operations.aws_migration_hub_strategy_recommendation.start_import_file_task

        (
            output,
            http_response,
        ) = await capo_migrationhubstrategy._operations.aws_migration_hub_strategy_recommendation.start_import_file_task.async_start_import_file_task(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartImportFileTask")
    )
    input_: capo_migrationhubstrategy.types.start_import_file_task_request.StartImportFileTaskRequest = {
        "name": name,
        "s3_bucket": s3_bucket,
        "s3key": s3key,
    }
    if data_source_type is not None:
        input_["data_source_type"] = data_source_type
    if group_id is not None:
        input_["group_id"] = group_id
    if s3bucket_for_report_data is not None:
        input_["s3bucket_for_report_data"] = s3bucket_for_report_data

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