From 922c08429adb00c24b26151ac4ff4d32bf7b9461 Mon Sep 17 00:00:00 2001 From: Ekaterina Chernitsyna Date: Tue, 1 Oct 2024 15:16:49 +0300 Subject: [PATCH] [#297] add morph rule chain --- src/frostfs_testlib/cli/frostfs_adm/morph.py | 37 +++++--------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/src/frostfs_testlib/cli/frostfs_adm/morph.py b/src/frostfs_testlib/cli/frostfs_adm/morph.py index 5b808ca..2958884 100644 --- a/src/frostfs_testlib/cli/frostfs_adm/morph.py +++ b/src/frostfs_testlib/cli/frostfs_adm/morph.py @@ -69,9 +69,7 @@ class FrostfsAdmMorph(CliCommand): **{param: param_value for param, param_value in locals().items() if param not in ["self"]}, ) - def set_config( - self, set_key_value: str, rpc_endpoint: Optional[str] = None, alphabet_wallets: Optional[str] = None - ) -> CommandResult: + def set_config(self, set_key_value: str, rpc_endpoint: Optional[str] = None, alphabet_wallets: Optional[str] = None) -> CommandResult: """Add/update global config value in the FrostFS network. Args: @@ -124,9 +122,7 @@ class FrostfsAdmMorph(CliCommand): **{param: param_value for param, param_value in locals().items() if param not in ["self"]}, ) - def force_new_epoch( - self, rpc_endpoint: Optional[str] = None, alphabet_wallets: Optional[str] = None - ) -> CommandResult: + def force_new_epoch(self, rpc_endpoint: Optional[str] = None, alphabet_wallets: Optional[str] = None) -> CommandResult: """Create new FrostFS epoch event in the side chain. Args: @@ -344,16 +340,11 @@ class FrostfsAdmMorph(CliCommand): return self._execute( f"morph remove-nodes {' '.join(node_netmap_keys)}", - **{ - param: param_value - for param, param_value in locals().items() - if param not in ["self", "node_netmap_keys"] - }, + **{param: param_value for param, param_value in locals().items() if param not in ["self", "node_netmap_keys"]}, ) - + def add_rule( self, - endpoint: str, chain_id: str, target_name: str, target_type: str, @@ -367,10 +358,8 @@ class FrostfsAdmMorph(CliCommand): """Drop objects from the node's local storage Args: - address: Address of wallet account chain-id: Assign ID to the parsed chain chain-id-hex: Flag to parse chain ID as hex - endpoint: Remote node control address (as 'multiaddr' or ':') path: Path to encoded chain in JSON or binary format rule: Rule statement target-name: Resource name in APE resource name format @@ -382,13 +371,12 @@ class FrostfsAdmMorph(CliCommand): Command`s result. """ return self._execute( - "control add-rule", + "morph ape add-rule-chain", **{param: value for param, value in locals().items() if param not in ["self"]}, ) def get_rule( self, - endpoint: str, chain_id: str, target_name: str, target_type: str, @@ -400,10 +388,8 @@ class FrostfsAdmMorph(CliCommand): """Drop objects from the node's local storage Args: - address string Address of wallet account chain-id string Chain id chain-id-hex Flag to parse chain ID as hex - endpoint string Remote node control address (as 'multiaddr' or ':') target-name string Resource name in APE resource name format target-type string Resource type(container/namespace) timeout duration Timeout for an operation (default 15s) @@ -413,7 +399,7 @@ class FrostfsAdmMorph(CliCommand): Command`s result. """ return self._execute( - "control get-rule", + "morph ape get-rule-chain", **{param: value for param, value in locals().items() if param not in ["self"]}, ) @@ -429,8 +415,6 @@ class FrostfsAdmMorph(CliCommand): """Drop objects from the node's local storage Args: - address: Address of wallet account - endpoint: Remote node control address (as 'multiaddr' or ':') target-name: Resource name in APE resource name format target-type: Resource type(container/namespace) timeout: Timeout for an operation (default 15s) @@ -443,10 +427,9 @@ class FrostfsAdmMorph(CliCommand): "morph ape list-rule-chains", **{param: value for param, value in locals().items() if param not in ["self"]}, ) - + def remove_rule( self, - endpoint: str, chain_id: str, target_name: str, target_type: str, @@ -459,11 +442,9 @@ class FrostfsAdmMorph(CliCommand): """Drop objects from the node's local storage Args: - address: Address of wallet account all: Remove all chains chain-id: Assign ID to the parsed chain chain-id-hex: Flag to parse chain ID as hex - endpoint: Remote node control address (as 'multiaddr' or ':') target-name: Resource name in APE resource name format target-type: Resource type(container/namespace) timeout: Timeout for an operation (default 15s) @@ -473,6 +454,6 @@ class FrostfsAdmMorph(CliCommand): Command`s result. """ return self._execute( - "control remove-rule", + "morph ape rm-rule-chain", **{param: value for param, value in locals().items() if param not in ["self"]}, - ) \ No newline at end of file + )