forked from TrueCloudLab/frostfs-testlib
33 lines
1.3 KiB
Python
33 lines
1.3 KiB
Python
from frostfs_testlib.storage.constants import _FrostfsServicesNames
|
|
from frostfs_testlib.storage.dataclasses.frostfs_services import (
|
|
HTTPGate,
|
|
InnerRing,
|
|
MainChain,
|
|
MorphChain,
|
|
S3Gate,
|
|
StorageNode,
|
|
)
|
|
from frostfs_testlib.storage.service_registry import ServiceRegistry
|
|
|
|
__class_registry = ServiceRegistry()
|
|
|
|
# Register default public services
|
|
__class_registry.register_service(_FrostfsServicesNames.STORAGE, StorageNode)
|
|
__class_registry.register_service(_FrostfsServicesNames.INNER_RING, InnerRing)
|
|
__class_registry.register_service(_FrostfsServicesNames.MORPH_CHAIN, MorphChain)
|
|
__class_registry.register_service(_FrostfsServicesNames.S3_GATE, S3Gate)
|
|
__class_registry.register_service(_FrostfsServicesNames.HTTP_GATE, HTTPGate)
|
|
# # TODO: Remove this since we are no longer have main chain
|
|
__class_registry.register_service(_FrostfsServicesNames.MAIN_CHAIN, MainChain)
|
|
|
|
|
|
def get_service_registry() -> ServiceRegistry:
|
|
"""Returns registry with registered classes related to cluster and cluster nodes.
|
|
|
|
ServiceClassRegistry is a singleton instance that can be configured with multiple classes that
|
|
represents service on the cluster physical node.
|
|
|
|
Returns:
|
|
Singleton ServiceClassRegistry instance.
|
|
"""
|
|
return __class_registry
|