forked from TrueCloudLab/frostfs-testlib
89 lines
2.5 KiB
Python
89 lines
2.5 KiB
Python
from abc import ABC, abstractmethod
|
|
from typing import List, Optional
|
|
|
|
from frostfs_testlib.storage.dataclasses.storage_object_info import NodeInfo, NodeNetInfo, NodeNetmapInfo
|
|
|
|
|
|
class NetmapInterface(ABC):
|
|
@abstractmethod
|
|
def epoch(
|
|
self,
|
|
rpc_endpoint: str,
|
|
wallet: Optional[str] = None,
|
|
address: Optional[str] = None,
|
|
generate_key: bool = False,
|
|
ttl: Optional[int] = None,
|
|
trace: Optional[bool] = False,
|
|
xhdr: Optional[dict] = None,
|
|
timeout: Optional[str] = None,
|
|
) -> int:
|
|
"""
|
|
Get current epoch number.
|
|
"""
|
|
raise NotImplementedError("No implemethed method epoch")
|
|
|
|
@abstractmethod
|
|
def netinfo(
|
|
self,
|
|
rpc_endpoint: str,
|
|
wallet: Optional[str] = None,
|
|
address: Optional[str] = None,
|
|
generate_key: bool = False,
|
|
json: bool = True,
|
|
ttl: Optional[int] = None,
|
|
xhdr: Optional[dict] = None,
|
|
timeout: Optional[str] = None,
|
|
) -> NodeNetInfo:
|
|
"""
|
|
Get target node info.
|
|
"""
|
|
raise NotImplementedError("No implemethed method netinfo")
|
|
|
|
@abstractmethod
|
|
def nodeinfo(
|
|
self,
|
|
rpc_endpoint: str,
|
|
wallet: Optional[str] = None,
|
|
address: Optional[str] = None,
|
|
generate_key: bool = False,
|
|
json: bool = True,
|
|
ttl: Optional[int] = None,
|
|
xhdr: Optional[dict] = None,
|
|
timeout: Optional[str] = None,
|
|
) -> NodeInfo:
|
|
"""
|
|
Get target node info.
|
|
"""
|
|
raise NotImplementedError("No implemethed method nodeinfo")
|
|
|
|
@abstractmethod
|
|
def snapshot(
|
|
self,
|
|
rpc_endpoint: str,
|
|
wallet: Optional[str] = None,
|
|
address: Optional[str] = None,
|
|
generate_key: bool = False,
|
|
ttl: Optional[int] = None,
|
|
xhdr: Optional[dict] = None,
|
|
timeout: Optional[str] = None,
|
|
) -> List[NodeNetmapInfo]:
|
|
"""
|
|
Get target node info.
|
|
"""
|
|
raise NotImplementedError("No implemethed method snapshot")
|
|
|
|
@abstractmethod
|
|
def snapshot_one_node(
|
|
self,
|
|
rpc_endpoint: str,
|
|
wallet: Optional[str] = None,
|
|
address: Optional[str] = None,
|
|
generate_key: bool = False,
|
|
ttl: Optional[int] = None,
|
|
xhdr: Optional[dict] = None,
|
|
timeout: Optional[str] = None,
|
|
) -> List[NodeNetmapInfo]:
|
|
"""
|
|
Get target one node info.
|
|
"""
|
|
raise NotImplementedError("No implemethed method snapshot")
|