Factory Data Storage

This is the developers' documentation of the Factory Data Storage component available in PISTIS factories.

Introduction

The Factory Data Storage acts as the primary database for a PISTIS factory. Factory users can upload their raw or processed datasets into this component as part of the data registration workflow. This component holds the actual datasets, while the Factory Data Catalogue contains the corresponding metadata. Each metadata record is represented as a dataset in the Factory Data Catalogue, with references to the actual datasets through distributions. Each distribution includes information about a dataset in the Factory Data Storage along with its unique ID. Following the data registration workflow, a dataset is created in the Factory Data Catalogue, featuring distributions that represent the actual dataset stored in the Factory Data Storage.

MongoDB and PostgreSQL are the main databases of this component along with an API to run CRUD operations on datasets in the database. MongoDB stores files and PostgreSQL stores datasets in the form of SQL tables. The API endpoints can only be authorized using a Bearer token from the PISTIS Keycloak.

Access

The API of the Factory Data Storage is available through: https://{FACTORYNAME}.pistis-market.eu/srv/factory-data-storage/

Usage - SQL tables

MethodInput parametersOutput
POST /create_tableJSON body including the dataset schema and rows200 success with UUID of the newly created SQL table
PUT /add_rowsJSON body including the additional dataset schema and rows200 success with UUID of the updated SQL table
GET /get_tableasset_uuid , JSON_output200 status with Table schema and rows of the table as JSON
DELETE /delete_tableasset_uuid200 status if the table is deleted
GET /count_rowsasset_uuid200 status with the total number of rows of a table
GET /get_all_tables--200 status with a list of all SQL tables as JSON
GET /get_fieldsasset_uuid , sort_column , sort_type , DISTINCT , OFFSET , LIMIT, JSON body with additional parameters200 status with rows of a table that satisfies the request as JSON

Usage - Files

MethodInput parametersOutput
POST /create_filefile200 status with UUID of the newly stored file
PUT /update_fileasset_uuid , file200 status with the UUID of the updated file
GET /get_fileasset_uuid200 status along with the file if it is available
GET /get_all_names--200 status with a list of all files as JSON
PUT /rename_fileasset_uuid , file_name200 status with confirmation that the file name was changed
DELETE /delete_fileasset_uuid200 status with the UUID of the deleted file
To learn about usage of the API endpoints, take a look at the Swagger documentation that is available in each factory through: https://{FACTORYNAME}.pistis-market.eu/srv/factory-data-storage/