Skip to content

BhavyaBibra/loopai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ingestion API

Overview

The Ingestion API is a RESTful service designed to handle batch ingestion of IDs with priority management and status tracking. It accepts batches of IDs, processes them asynchronously based on priority, and provides endpoints to check the status of ingestions and their individual batches.

Features

  • Accepts batch ingestion requests with a list of IDs and a priority level (LOW, MEDIUM, or HIGH)
  • Automatically splits large ID lists into batches of maximum 3 IDs each
  • Provides asynchronous processing of batches respecting priority levels
  • Status endpoint to query the current state of an ingestion and its batches

Installation

Clone the repository and install dependencies:

npm install

API Endpoints
POST /ingest
Submit a batch ingestion request.

Request Body:

{
  "ids": [1, 2, 3, 4, 5],
  "priority": "MEDIUM"
}
Response:

{
  "ingestion_id": "string-unique-id"
}
Notes:

The API accepts any number of IDs but splits them into batches of up to 3 IDs each internally.

Priority can be LOW, MEDIUM, or HIGH.

GET /status/:ingestion_id
Retrieve the current status of an ingestion request.

Response:

{
  "ingestion_id": "string-unique-id",
  "status": "string-status",
  "batches": [
    {
      "batch_id": "string-batch-id",
      "ids": [1, 2, 3],
      "status": "string-status"
    }
    // ... more batches
  ]
}
Status values may include yet_to_start, triggered, completed, etc.

Testing
Run automated tests with:

npm test
Note: Some tests may intermittently fail or return unexpected status codes due to asynchronous processing timing or API implementation specifics.

Known Issues
Some endpoints may return HTTP status 202 Accepted instead of 200 OK for successful ingestion requests.

The status endpoint may return 404 Not Found if queried too soon after ingestion.


Author
Bhavya Bibra

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors