Kestrel Data Source ReturnStruct

class kestrel.datasource.retstruct.AbstractReturnStruct[source]

Bases: abc.ABC

The abstract class for creating return objects.

  1. it should have a constructor for the interface to create it. The interface should specify the query_id in the constructor.

  2. it should have a load_to_store method for Kestrel runtime to load data from it.

abstract load_to_store(store)[source]

Load the data (from data source) to store.

Returns

the query_id, which is a identifier in the store associated with the loaded data entries.

Return type

str

class kestrel.datasource.retstruct.ReturnFromFile(query_id, file_paths)[source]

Bases: kestrel.datasource.retstruct.AbstractReturnStruct

The return structure when the data source interface uses files as intermediate storage before loading to store.

Parameters
  • query_id (str) – typically just a UUID.

  • file_paths ([str]) – the list of stix bundle file paths.

load_to_store(store)[source]

Load the data (from data source) to store.

Returns

the query_id, which is a identifier in the store associated with the loaded data entries.

Return type

str

class kestrel.datasource.retstruct.ReturnFromStore(query_id)[source]

Bases: kestrel.datasource.retstruct.AbstractReturnStruct

The return structure when the data source interface directly operates on the store.

Parameters

query_id (str) – typically just a UUID.

load_to_store(store)[source]

Load the data (from data source) to store.

Returns

the query_id, which is a identifier in the store associated with the loaded data entries.

Return type

str