forked from TrueCloudLab/frostfs-testlib
[#288] Update object and chunks Clients
Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
parent
d2f8323fb9
commit
84e83487f9
2 changed files with 52 additions and 13 deletions
|
@ -370,11 +370,11 @@ class FrostfsCliObject(CliCommand):
|
||||||
self,
|
self,
|
||||||
rpc_endpoint: str,
|
rpc_endpoint: str,
|
||||||
cid: str,
|
cid: str,
|
||||||
|
oid: Optional[str] = None,
|
||||||
wallet: Optional[str] = None,
|
wallet: Optional[str] = None,
|
||||||
address: Optional[str] = None,
|
address: Optional[str] = None,
|
||||||
bearer: Optional[str] = None,
|
bearer: Optional[str] = None,
|
||||||
generate_key: Optional[bool] = None,
|
generate_key: Optional[bool] = None,
|
||||||
oid: Optional[str] = None,
|
|
||||||
trace: bool = False,
|
trace: bool = False,
|
||||||
root: bool = False,
|
root: bool = False,
|
||||||
verify_presence_all: bool = False,
|
verify_presence_all: bool = False,
|
||||||
|
|
|
@ -60,7 +60,6 @@ class ChunksOperations(interfaces.ChunksInterface):
|
||||||
rpc_endpoint: str,
|
rpc_endpoint: str,
|
||||||
cid: str,
|
cid: str,
|
||||||
oid: str,
|
oid: str,
|
||||||
wallet: Optional[str] = None,
|
|
||||||
address: Optional[str] = None,
|
address: Optional[str] = None,
|
||||||
bearer: Optional[str] = None,
|
bearer: Optional[str] = None,
|
||||||
generate_key: Optional[bool] = None,
|
generate_key: Optional[bool] = None,
|
||||||
|
@ -72,15 +71,28 @@ class ChunksOperations(interfaces.ChunksInterface):
|
||||||
xhdr: Optional[dict] = None,
|
xhdr: Optional[dict] = None,
|
||||||
timeout: Optional[str] = None,
|
timeout: Optional[str] = None,
|
||||||
) -> list[Chunk]:
|
) -> list[Chunk]:
|
||||||
object_nodes = self.cli.object.nodes(**{param: value for param, value in locals().items() if param not in ["self"]})
|
object_nodes = self.cli.object.nodes(
|
||||||
return self._parse_object_nodes(object_nodes.stdout)
|
rpc_endpoint=rpc_endpoint,
|
||||||
|
cid=cid,
|
||||||
|
address=address,
|
||||||
|
bearer=bearer,
|
||||||
|
generate_key=generate_key,
|
||||||
|
oid=oid,
|
||||||
|
trace=trace,
|
||||||
|
root=root,
|
||||||
|
verify_presence_all=verify_presence_all,
|
||||||
|
json=json,
|
||||||
|
ttl=ttl,
|
||||||
|
xhdr=xhdr,
|
||||||
|
timeout=timeout,
|
||||||
|
)
|
||||||
|
return self._parse_object_nodes(object_nodes.stdout.split("\n")[0])[0]
|
||||||
|
|
||||||
@reporter.step("Get last parity chunk")
|
@reporter.step("Get last parity chunk")
|
||||||
def get_parity(
|
def get_parity(
|
||||||
self,
|
self,
|
||||||
rpc_endpoint: str,
|
rpc_endpoint: str,
|
||||||
cid: str,
|
cid: str,
|
||||||
wallet: Optional[str] = None,
|
|
||||||
address: Optional[str] = None,
|
address: Optional[str] = None,
|
||||||
bearer: Optional[str] = None,
|
bearer: Optional[str] = None,
|
||||||
generate_key: Optional[bool] = None,
|
generate_key: Optional[bool] = None,
|
||||||
|
@ -93,29 +105,56 @@ class ChunksOperations(interfaces.ChunksInterface):
|
||||||
xhdr: Optional[dict] = None,
|
xhdr: Optional[dict] = None,
|
||||||
timeout: Optional[str] = None,
|
timeout: Optional[str] = None,
|
||||||
) -> Chunk:
|
) -> Chunk:
|
||||||
object_nodes = self.cli.object.nodes(**{param: value for param, value in locals().items() if param not in ["self"]})
|
object_nodes = self.cli.object.nodes(
|
||||||
return self._parse_object_nodes(object_nodes.stdout)[-1]
|
rpc_endpoint=rpc_endpoint,
|
||||||
|
cid=cid,
|
||||||
|
address=address,
|
||||||
|
bearer=bearer,
|
||||||
|
generate_key=generate_key,
|
||||||
|
oid=oid,
|
||||||
|
trace=trace,
|
||||||
|
root=root,
|
||||||
|
verify_presence_all=verify_presence_all,
|
||||||
|
json=json,
|
||||||
|
ttl=ttl,
|
||||||
|
xhdr=xhdr,
|
||||||
|
timeout=timeout,
|
||||||
|
)
|
||||||
|
return self._parse_object_nodes(object_nodes.stdout.split("\n")[0])[0]
|
||||||
|
|
||||||
@reporter.step("Get first data chunk")
|
@reporter.step("Get first data chunk")
|
||||||
def get_first_data(
|
def get_first_data(
|
||||||
self,
|
self,
|
||||||
rpc_endpoint: str,
|
rpc_endpoint: str,
|
||||||
cid: str,
|
cid: str,
|
||||||
wallet: Optional[str] = None,
|
oid: Optional[str] = None,
|
||||||
address: Optional[str] = None,
|
address: Optional[str] = None,
|
||||||
bearer: Optional[str] = None,
|
bearer: Optional[str] = None,
|
||||||
generate_key: Optional[bool] = None,
|
generate_key: Optional[bool] = None,
|
||||||
oid: Optional[str] = None,
|
trace: bool = True,
|
||||||
trace: bool = False,
|
|
||||||
root: bool = False,
|
root: bool = False,
|
||||||
verify_presence_all: bool = False,
|
verify_presence_all: bool = False,
|
||||||
json: bool = True,
|
json: bool = True,
|
||||||
ttl: Optional[int] = None,
|
ttl: Optional[int] = None,
|
||||||
xhdr: Optional[dict] = None,
|
xhdr: Optional[dict] = None,
|
||||||
timeout: Optional[str] = None,
|
timeout: Optional[str] = CLI_DEFAULT_TIMEOUT,
|
||||||
) -> Chunk:
|
) -> Chunk:
|
||||||
object_nodes = self.cli.object.nodes(**{param: value for param, value in locals().items() if param not in ["self"]})
|
object_nodes = self.cli.object.nodes(
|
||||||
return self._parse_object_nodes(object_nodes.stdout)[0]
|
rpc_endpoint=rpc_endpoint,
|
||||||
|
cid=cid,
|
||||||
|
address=address,
|
||||||
|
bearer=bearer,
|
||||||
|
generate_key=generate_key,
|
||||||
|
oid=oid,
|
||||||
|
trace=trace,
|
||||||
|
root=root,
|
||||||
|
verify_presence_all=verify_presence_all,
|
||||||
|
json=json,
|
||||||
|
ttl=ttl,
|
||||||
|
xhdr=xhdr,
|
||||||
|
timeout=timeout,
|
||||||
|
)
|
||||||
|
return self._parse_object_nodes(object_nodes.stdout.split("\n")[0])[0]
|
||||||
|
|
||||||
def _parse_object_nodes(self, object_nodes: str) -> list[Chunk]:
|
def _parse_object_nodes(self, object_nodes: str) -> list[Chunk]:
|
||||||
parse_result = json.loads(object_nodes)
|
parse_result = json.loads(object_nodes)
|
||||||
|
|
Loading…
Reference in a new issue