OpenSearchServiceServerless / Client / create_ingestion_job

create_ingestion_job

OpenSearchServiceServerless.Client.create_ingestion_job(**kwargs)

Creates an ingestion job that performs a one-time bulk ingestion of data from an Amazon S3 bucket into an index in an OpenSearch Serverless collection. An ingestion job scans the source bucket, indexes the documents it finds, and then completes. To continuously ingest new data as it arrives, use CreateIngestionStream instead.

See also: AWS API Documentation

Request Syntax

response = client.create_ingestion_job(
    collectionId='string',
    ingestionJobName='string',
    indexName='string',
    failureIndexName='string',
    source={
        's3': {
            'bucket': 'string',
            'bucketOwnerAccountId': 'string',
            'keyPrefix': 'string'
        }
    },
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ],
    clientToken='string'
)
Parameters:
  • collectionId (string) –

    [REQUIRED]

    The unique identifier of the collection to ingest data into.

  • ingestionJobName (string) –

    [REQUIRED]

    The name of the ingestion job. The name must be unique within the collection.

  • indexName (string) –

    [REQUIRED]

    The name of the index to ingest documents into.

  • failureIndexName (string) – The name of the index where documents that fail to be ingested are recorded.

  • source (dict) –

    [REQUIRED]

    The Amazon S3 source to ingest data from.

    • s3 (dict) – [REQUIRED]

      The Amazon S3 source configuration for the ingestion job.

      • bucket (string) –

        The name or Amazon Resource Name (ARN) of the Amazon S3 bucket to ingest data from.

      • bucketOwnerAccountId (string) –

        The Amazon Web Services account ID that owns the Amazon S3 bucket.

      • keyPrefix (string) –

        A key prefix that limits ingestion to objects in the Amazon S3 bucket whose keys begin with the prefix.

  • tags (list) –

    An arbitrary set of tags (key–value pairs) to associate with the ingestion job.

    • (dict) –

      A map of key-value pairs associated to an OpenSearch Serverless resource.

      • key (string) – [REQUIRED]

        The key to use in the tag.

      • value (string) – [REQUIRED]

        The value of the tag.

  • clientToken (string) –

    Unique, case-sensitive identifier to ensure idempotency of the request.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'ingestionJobDetail': {
        'ingestionJobId': 'string',
        'arn': 'string',
        'collectionId': 'string',
        'ingestionJobName': 'string',
        'indexName': 'string',
        'failureIndexName': 'string',
        'source': {
            's3': {
                'bucket': 'string',
                'bucketOwnerAccountId': 'string',
                'keyPrefix': 'string'
            }
        },
        'status': 'CREATING'|'ACTIVE'|'COMPLETED'|'CANCELLING'|'CANCELLED'|'FAILED'|'CREATE_FAILED'|'CANCEL_FAILED',
        'state': 'STARTING'|'SCANNING'|'INGESTION_IN_PROGRESS'|'INGESTION_COMPLETE'|'STOPPED'|'FAILED',
        'statistics': {
            's3': {
                'objectsDiscovered': 123,
                'objectsIngested': 123,
                'objectsFailed': 123
            }
        },
        'revision': 123,
        'createdAt': datetime(2015, 1, 1),
        'updatedAt': datetime(2015, 1, 1),
        'failureReasons': [
            {
                'code': 'SOURCE_ACCESS_DENIED'|'SOURCE_RESOURCE_NOT_FOUND'|'DESTINATION_ACCESS_DENIED'|'DESTINATION_RESOURCE_NOT_FOUND'|'INTERNAL_SERVER_ERROR',
                'message': 'string'
            },
        ],
        'activeAlerts': [
            {
                'code': 'SOURCE_ACCESS_DENIED'|'SOURCE_RESOURCE_NOT_FOUND'|'DESTINATION_ACCESS_DENIED'|'DESTINATION_RESOURCE_NOT_FOUND'|'INTERNAL_SERVER_ERROR',
                'message': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) –

    • ingestionJobDetail (dict) –

      Details about the created ingestion job.

      • ingestionJobId (string) –

        The unique identifier of the ingestion job.

      • arn (string) –

        The Amazon Resource Name (ARN) of the ingestion job.

      • collectionId (string) –

        The unique identifier of the collection that the ingestion job belongs to.

      • ingestionJobName (string) –

        The name of the ingestion job.

      • indexName (string) –

        The name of the index that documents are ingested into.

      • failureIndexName (string) –

        The name of the index where documents that fail to be ingested are recorded.

      • source (dict) –

        The Amazon S3 source that the ingestion job ingests data from.

        • s3 (dict) –

          The Amazon S3 source configuration for the ingestion job.

          • bucket (string) –

            The name or Amazon Resource Name (ARN) of the Amazon S3 bucket to ingest data from.

          • bucketOwnerAccountId (string) –

            The Amazon Web Services account ID that owns the Amazon S3 bucket.

          • keyPrefix (string) –

            A key prefix that limits ingestion to objects in the Amazon S3 bucket whose keys begin with the prefix.

      • status (string) –

        The current lifecycle status of the ingestion job. For example, CREATING, ACTIVE, COMPLETED, or CANCELLED.

      • state (string) –

        The current processing state of the ingestion job. For example, SCANNING, INGESTION_IN_PROGRESS, or INGESTION_COMPLETE.

      • statistics (dict) –

        Processing statistics for the ingestion job, such as the number of Amazon S3 objects discovered, ingested, and failed.

        • s3 (dict) –

          Processing statistics for the Amazon S3 source.

          • objectsDiscovered (integer) –

            The number of Amazon S3 objects discovered for ingestion.

          • objectsIngested (integer) –

            The number of Amazon S3 objects successfully ingested.

          • objectsFailed (integer) –

            The number of Amazon S3 objects that failed to be ingested.

      • revision (integer) –

        The revision number of the ingestion job.

      • createdAt (datetime) –

        The date and time when the ingestion job was created.

      • updatedAt (datetime) –

        The date and time when the ingestion job was last updated.

      • failureReasons (list) –

        The reasons that the ingestion job reached a terminal failure state, if applicable.

        • (dict) –

          A terminal failure reason explaining why an ingestion stopped.

          • code (string) –

            The code that identifies the reason for the failure.

          • message (string) –

            A description of the reason for the failure.

      • activeAlerts (list) –

        Active alerts about operational issues that currently affect the ingestion job. Alerts are cleared when the issue is resolved.

        • (dict) –

          An active alert about a running ingestion — operational issues or updates to processing state. Cleared when the issue resolves.

          • code (string) –

            The code that identifies the alert.

          • message (string) –

            A description of the alert.

Exceptions