Skip to content

create_data_set_import_task async

create_data_set_import_task(
    application_id: Identifier,
    import_config: DataSetImportConfig,
    *,
    config_overrides: Optional[Asyncm2ClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateDataSetImportTaskResponse

Starts a data set import task for a specific application.

Parameters:

  • application_id (Identifier) –

    The unique identifier of the application for which you want to import data sets.

  • import_config (DataSetImportConfig) –

    The data set import task configuration.

  • client_token (Optional[ClientToken], default: None ) –

    Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create a data set import. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.

Raises:

Source code in docs_src/capo_m2/_services/async_m2.py
async def create_data_set_import_task(
    self,
    application_id: "capo_m2.types.identifier.Identifier",
    import_config: "capo_m2.types.data_set_import_config.DataSetImportConfig",
    *,
    config_overrides: Optional[Asyncm2ClientConfig] = None,
    client_token: Optional["capo_m2.types.client_token.ClientToken"] = None,
) -> "capo_m2.types.create_data_set_import_task_response.CreateDataSetImportTaskResponse":
    """<p>Starts a data set import task for a specific application.</p>

    Args:
        application_id: <p>The unique identifier of the application for which you want to import data sets.</p>
        import_config: <p>The data set import task configuration.</p>
        client_token: <p> Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create a data set import. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires. </p>

    Raises:
        capo_m2.errors.access_denied_exception.AccessDeniedException: <p>The account or role doesn't have the right permissions to make the request.</p>
        capo_m2.errors.conflict_exception.ConflictException: <p>The parameters provided in the request conflict with existing resources.</p>
        capo_m2.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_m2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_m2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>One or more quotas for Amazon Web Services Mainframe Modernization exceeds the limit.</p>
        capo_m2.errors.throttling_exception.ThrottlingException: <p>The number of requests made exceeds the limit.</p>
        capo_m2.errors.validation_exception.ValidationException: <p>One or more parameters provided in the request is not valid.</p>
        capo_m2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_m2.types.create_data_set_import_task_request.CreateDataSetImportTaskRequest]",
    ) -> AsyncOperationResponse[
        "capo_m2.types.create_data_set_import_task_response.CreateDataSetImportTaskResponse"
    ]:
        import capo_m2._operations.aws_supernova_control_plane_service.create_data_set_import_task

        (
            output,
            http_response,
        ) = await capo_m2._operations.aws_supernova_control_plane_service.create_data_set_import_task.async_create_data_set_import_task(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDataSetImportTask")
    )
    input_: capo_m2.types.create_data_set_import_task_request.CreateDataSetImportTaskRequest = {
        "application_id": application_id,
        "import_config": import_config,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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