startIngestionJob method

Future<StartIngestionJobResponse> startIngestionJob({
  1. required String dataSourceId,
  2. required String knowledgeBaseId,
  3. String? clientToken,
  4. String? description,
})

Begins a data ingestion job. Data sources are ingested into your knowledge base so that Large Language Models (LLMs) can use your data.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter dataSourceId : The unique identifier of the data source you want to ingest into your knowledge base.

Parameter knowledgeBaseId : The unique identifier of the knowledge base for the data ingestion job.

Parameter clientToken : A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.

Parameter description : A description of the data ingestion job.

Implementation

Future<StartIngestionJobResponse> startIngestionJob({
  required String dataSourceId,
  required String knowledgeBaseId,
  String? clientToken,
  String? description,
}) async {
  final $payload = <String, dynamic>{
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/datasources/${Uri.encodeComponent(dataSourceId)}/ingestionjobs/',
    exceptionFnMap: _exceptionFns,
  );
  return StartIngestionJobResponse.fromJson(response);
}