Ingress API
The Ingress API is a RESTful API that is configured to take disparate data sources and store them in a cache for later retrieval.
Endpoints
1. POST /upload/
This is a general-purpose endpoint for uploading data. It automatically detects the content type of the uploaded data and processes it accordingly.
- Request:
request: The HTTP request object.content_type: The content type of the data being uploaded (automatically extracted from headers).-
vendor_id: The identifier of the vendor making the upload request (extracted via authentication). -
Response:
- Returns a status message indicating the success or failure of the upload.
2. POST /upload-json/
This endpoint is specialized for handling JSON data uploads.
- Request:
request: The HTTP request object containing JSON data.-
vendor_id: The identifier of the vendor making the upload request (extracted via authentication). -
Response:
- Returns a status message indicating the success or failure of the JSON data upload.
3. POST /upload-file/
This endpoint is designed for handling the upload of a single file.
- Request:
file: The file to be uploaded.-
vendor_id: The identifier of the vendor making the upload request (extracted via authentication). -
Response:
- Returns a status message indicating the success or failure of the file upload.
4. POST /upload-batch/
This endpoint allows for the batch upload of multiple files.
- Request:
files: A list of files to be uploaded.-
vendor_id: The identifier of the vendor making the upload request (extracted via authentication). -
Response:
- Returns a status message indicating the success or failure of the batch file upload.
5. POST /upload-stream/
This endpoint handles the upload of streaming data.
- Request:
request: The HTTP request object containing the stream of data.-
vendor_id: The identifier of the vendor making the upload request (extracted via authentication). -
Response:
- Returns a status message indicating the success or failure of the stream upload.
Security
All data uploaded through these endpoints is stored in an encrypted form within the cache, ensuring that sensitive information is protected at all times.
Dependencies
- FastAPI: For creating the API endpoints.
- Depends: Dependency injection system used to manage request-specific data like content type and vendor identity.
- Request: To handle incoming HTTP requests.
- UploadFile: For managing file uploads.
How to Use
- Make a POST request to any of the above endpoints with the appropriate data type.
- Include the necessary headers and authentication credentials.
- Receive a response indicating the status of your upload.
This API is flexible and can accommodate various data types, making it an ideal solution for applications requiring secure and efficient data upload handling.