Result API
api_delete_result(res_id)
Deletes a result by its identifier.
This function takes a result ID as input and calls the delete method from the Result class to remove the specified result from storage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
res_id |
str
|
The unique identifier of the result to be deleted. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the result was successfully deleted. |
Raises:
Type | Description |
---|---|
Exception
|
If the deletion process encounters an error. |
Source code in moonshot/src/api/api_result.py
api_get_all_result()
This function retrieves all available results and returns them as a list of dictionaries. Each dictionary represents a result and contains its information.
Returns:
Type | Description |
---|---|
list[dict]
|
list[dict]: A list of dictionaries, each representing a result. |
Source code in moonshot/src/api/api_result.py
api_get_all_result_name()
This function retrieves all available result names and returns them as a list.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list of result names. |
Source code in moonshot/src/api/api_result.py
api_read_result(res_id)
Reads a result and returns its information.
This function takes a result ID as input, reads the corresponding database file from the storage manager, and returns a dictionary containing the result's information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
res_id |
str
|
The ID of the result. |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
A dictionary containing the result's information. |
Source code in moonshot/src/api/api_result.py
api_read_results(res_ids)
Reads multiple results and returns their information.
This function takes a list of result IDs as input, reads the corresponding database files from the storage manager, and returns a list of dictionaries, each containing a result's information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
res_ids |
conlist(str, min_length=1
|
A list of result IDs. |
required |
Returns:
Type | Description |
---|---|
list[dict]
|
list[dict]: A list of dictionaries, each containing a result's information. |