Skip to content

Commit d5fb7f8

Browse files
mgr/smb: add new ResourceKey protocol class
Add a new protocol class that can be used to uniquely identify a resource within a given store namespace. The idea is to use this key class where a resource can be ID'd by either one metadata field or by two allowing more common interfaces and fewer special code paths. Signed-off-by: John Mulligan <[email protected]>
1 parent f768b92 commit d5fb7f8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/pybind/mgr/smb/proto.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ def to_simplified(self) -> Simplified:
5353
FindParams = Dict[str, Any]
5454

5555

56+
class ResourceKey(Protocol):
57+
"""An object representing a key for a singular object in a store.
58+
This key may be comprised of one or more input values.
59+
"""
60+
61+
def __str__(self) -> str:
62+
... # pragma: no cover
63+
64+
5665
class ConfigEntry(Protocol):
5766
"""A protocol for describing a configuration object that can be kept within
5867
a configuration store. Has the ability to identify itself either by a

0 commit comments

Comments
 (0)