[#297] add morph rule chain

This commit is contained in:
Ekaterina Chernitsyna 2024-10-21 23:47:47 +03:00
parent dea6dc3396
commit 947e02c72f
2 changed files with 23 additions and 20 deletions

View file

@ -122,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, delta: Optional[int] = 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:
@ -343,11 +341,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,
@ -361,10 +359,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 '<host>:<port>')
path: Path to encoded chain in JSON or binary format
rule: Rule statement
target-name: Resource name in APE resource name format
@ -376,13 +372,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,
@ -394,10 +389,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 '<host>:<port>')
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)
@ -407,7 +400,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"]},
)
@ -423,8 +416,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 '<host>:<port>')
target-name: Resource name in APE resource name format
target-type: Resource type(container/namespace)
timeout: Timeout for an operation (default 15s)
@ -440,7 +431,6 @@ class FrostfsAdmMorph(CliCommand):
def remove_rule(
self,
endpoint: str,
chain_id: str,
target_name: str,
target_type: str,
@ -453,11 +443,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 '<host>:<port>')
target-name: Resource name in APE resource name format
target-type: Resource type(container/namespace)
timeout: Timeout for an operation (default 15s)
@ -467,6 +455,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"]},
)

View file

@ -26,6 +26,21 @@ class ObjectOperations(HumanReadableEnum):
return [op for op in ObjectOperations if op != ObjectOperations.WILDCARD_ALL]
@dataclass
class Operations:
GET_CONTAINER = "GetContainer"
PUT_CONTAINER = "PutContainer"
DELETE_CONTAINER = "DeleteContainer"
LIST_CONTAINER = "ListContainers"
GET_OBJECT = "GetObject"
DELETE_OBJECT = "DeleteObject"
HASH_OBJECT = "HashObject"
RANGE_OBJECT = "RangeObject"
SEARCH_OBJECT = "SearchObject"
HEAD_OBJECT = "HeadObject"
PUT_OBJECT = "PutObject"
class Verb(HumanReadableEnum):
ALLOW = "allow"
DENY = "deny"