Metric API
api_delete_metric(met_id)
Deletes a metric identified by its unique metric ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
met_id |
str
|
The unique identifier for the metric to be deleted. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the metric was successfully deleted. |
Raises:
Type | Description |
---|---|
Exception
|
If the deletion process encounters an error. |
Source code in moonshot/src/api/api_metrics.py
api_get_all_metric()
Retrieves all available metrics.
This function calls the get_available_items method from the Metric class to retrieve all available metrics. It then returns a list of dictionaries, each containing the details of a metric.
Returns:
Type | Description |
---|---|
list[dict]
|
list[dict]: A list of dictionaries, each representing a metric's details. |
Source code in moonshot/src/api/api_metrics.py
api_get_all_metric_name()
Retrieves all available metric names.
This function calls the get_available_items method from the Metric class to retrieve all available metrics. It then extracts the names of each metric and returns a list of these names.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list of strings, each representing a metric name. |