virtualscanner.server.registration¶
Register page: log phantom/subject information
db_operations_mgr.py¶
-
create
()¶ This function creates a database with the required fields in the REGISTRATION table.
- Returns
status – | 0: successful creation of the database and table | 1: fail
- Return type
int
-
insert
(payload)¶ This function inserts a new row for a registered subject in the REGISTRATION table.
- Parameters
payload (dict) – Information as per the REGISTRATION TABLE fields for the new subject to be inserted
- Returns
status – | 0: successful insertion of the row | 1: fail
- Return type
int
-
query
(payload)¶ This function queries the REGISTRATION table for existing subject information.
- Parameters
payload (dict) – Information as per the REGISTRATION TABLE fields for the new subject to be inserted
- Returns
rows – rows from the RESGISTRATION table that match the query criteria
- Return type
dict
register.py¶
-
consume
(payload)¶ This definition processes a payload
Creates a database if it does not exist
Appends registration data
- Parameters
payload (dict) – all fields required in the REGISTRATION table
- Returns
status – 0: successful creation of the database (if required) and insertion of one row 1: fail
- Return type
int
-
reuse
(payload)¶ This definition queries if the subject is already registered
- Parameters
payload (dict) – All fields required in the REGISTRATION table
- Returns
rows – row of the REGISTRATION table that match the subject being registered a null value indicates a new subject non null value(s) indicate matching subjects
- Return type
dict