Module markov.api.models.registry.model_registry
Classes
class ModelRegistry-
A class representing a registry of models within the Markov system.
This class provides methods to interact with the model registry, including creating registry instances from records, retrieving all registries or a specific registry by ID or name, linking models to registries, and generating printable representations of registry instances.
Attributes
registry_id:str- Unique identifier for the registry.
registry_name:str- Name of the registry.
created_by:str- Identifier of the user who created the registry.
create_date:str- Date when the registry was created.
Initializes a new instance of the ModelRegistry class with default values.
Static methods
def get_all() ‑> List[ModelRegistry]-
Retrieves all model registries from the backend.
Returns
List[ModelRegistry]- A list of ModelRegistry instances representing all registries retrieved from the backend.
Returns an empty list if no registries are found.
def get_by_id(registry_id: str) ‑> ModelRegistry-
Retrieves a model registry by its unique identifier.
Args
registry_id:str- The unique identifier of the registry to retrieve.
Returns
ModelRegistry- An instance of ModelRegistry corresponding to the specified ID.
Raises
ResourceNotFoundException- If no registry with the specified ID is found.
def get_by_name(registry_name: str) ‑> ModelRegistry-
Retrieves a model registry by its name.
Args
registry_name:str- The name of the registry to retrieve.
Returns
ModelRegistry- An instance of ModelRegistry corresponding to the specified name.
Raises
ResourceNotFoundException- If no registry with the specified name is found.
Methods
def get_printable(self)def link_model_to_registry(self, model_id: str)-
Links a model to this registry by the model's unique identifier.
Args
model_id:str- The unique identifier of the model to link.
Returns
str- The registry ID to which the model was linked.
Raises
ValueError- If the ModelRegistry instance has not been initialized with a registry ID.