]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/smb: add new ResourceKey protocol class
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 1 Jul 2025 21:15:10 +0000 (17:15 -0400)
committerAdam King <adking@redhat.com>
Thu, 10 Jul 2025 16:02:38 +0000 (12:02 -0400)
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 <jmulligan@redhat.com>
(cherry picked from commit d5fb7f8c2ba84ac9ecfc38365027f2c3a6531130)

src/pybind/mgr/smb/proto.py

index 847869a3cbe84fd3c9f4fbb532afe39cd64449f6..b04c3e90e0e4abcdf3c8d9b869f19c5d3d3c3786 100644 (file)
@@ -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