From: John Mulligan Date: Tue, 1 Jul 2025 21:15:10 +0000 (-0400) Subject: mgr/smb: add new ResourceKey protocol class X-Git-Tag: v20.1.0~40^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f2f018ff4722bba3801683bc20846c69043c5a0a;p=ceph.git 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 (cherry picked from commit d5fb7f8c2ba84ac9ecfc38365027f2c3a6531130) --- diff --git a/src/pybind/mgr/smb/proto.py b/src/pybind/mgr/smb/proto.py index 847869a3cbe..b04c3e90e0e 100644 --- a/src/pybind/mgr/smb/proto.py +++ b/src/pybind/mgr/smb/proto.py @@ -53,6 +53,15 @@ EntryKey = Tuple[str, str] FindParams = Dict[str, Any] +class ResourceKey(Protocol): + """An object representing a key for a singular object in a store. + This key may be comprised of one or more input values. + """ + + def __str__(self) -> str: + ... # pragma: no cover + + class ConfigEntry(Protocol): """A protocol for describing a configuration object that can be kept within a configuration store. Has the ability to identify itself either by a