mirror of
https://github.com/OpenKMIP/PyKMIP.git
synced 2025-06-04 06:00:07 +02:00
Add the missing locate/activate KmipClient abstractmethod definition
This commit is contained in:
parent
19560b92b7
commit
ec4dae707c
@ -60,6 +60,25 @@ class KmipClient:
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@abc.abstractmethod
|
||||||
|
def locate(self, maximum_items, storage_status_mask, object_group_member,
|
||||||
|
attributes):
|
||||||
|
"""
|
||||||
|
Search for managed objects with a KMIP appliance.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
maximum_items (integer): Maximum number of object identifiers the
|
||||||
|
server MAY return.
|
||||||
|
storage_status_mask (integer): A bit mask that indicates whether
|
||||||
|
on-line or archived objects are to be searched.
|
||||||
|
object_group_member (ObjectGroupMember): An enumeration that
|
||||||
|
indicates the object group member type.
|
||||||
|
attributes (list): Attributes the are REQUIRED to match those in a
|
||||||
|
candidate object.
|
||||||
|
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def get(self, uid):
|
def get(self, uid):
|
||||||
"""
|
"""
|
||||||
@ -81,6 +100,16 @@ class KmipClient:
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@abc.abstractmethod
|
||||||
|
def activate(self, uid):
|
||||||
|
"""
|
||||||
|
Activate a managed object stored by a KMIP appliance.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
uid (string): The unique ID of the managed object to activate.
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def destroy(self, uid):
|
def destroy(self, uid):
|
||||||
"""
|
"""
|
||||||
@ -92,15 +121,15 @@ class KmipClient:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def mac(self, uid, algorithm, data):
|
def mac(self, data, uid, algorithm):
|
||||||
"""
|
"""
|
||||||
Get the message authentication code for data.
|
Get the message authentication code for data.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
data (string): The data to be MACed.
|
||||||
uid (string): The unique ID of the managed object that is the key
|
uid (string): The unique ID of the managed object that is the key
|
||||||
to use for the MAC operation.
|
to use for the MAC operation.
|
||||||
algorithm (CryptographicAlgorithm): An enumeration defining the
|
algorithm (CryptographicAlgorithm): An enumeration defining the
|
||||||
algorithm to use to generate the MAC.
|
algorithm to use to generate the MAC.
|
||||||
data (string): The data to be MACed.
|
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
@ -35,17 +35,26 @@ class DummyKmipClient(api.KmipClient):
|
|||||||
def register(self, managed_object, *args, **kwargs):
|
def register(self, managed_object, *args, **kwargs):
|
||||||
super(DummyKmipClient, self).register(managed_object)
|
super(DummyKmipClient, self).register(managed_object)
|
||||||
|
|
||||||
|
def locate(self, maximum_items, storage_status_mask, object_group_member,
|
||||||
|
attributes):
|
||||||
|
super(DummyKmipClient, self).locate(
|
||||||
|
maximum_items, storage_status_mask, object_group_member,
|
||||||
|
attributes)
|
||||||
|
|
||||||
def get(self, uid, *args, **kwargs):
|
def get(self, uid, *args, **kwargs):
|
||||||
super(DummyKmipClient, self).get(uid)
|
super(DummyKmipClient, self).get(uid)
|
||||||
|
|
||||||
def get_attribute_list(self, uid, *args, **kwargs):
|
def get_attribute_list(self, uid, *args, **kwargs):
|
||||||
super(DummyKmipClient, self).get_attribute_list(uid)
|
super(DummyKmipClient, self).get_attribute_list(uid)
|
||||||
|
|
||||||
|
def activate(self, uid):
|
||||||
|
super(DummyKmipClient, self).activate(uid)
|
||||||
|
|
||||||
def destroy(self, uid):
|
def destroy(self, uid):
|
||||||
super(DummyKmipClient, self).destroy(uid)
|
super(DummyKmipClient, self).destroy(uid)
|
||||||
|
|
||||||
def mac(self, uid, algorithm, data):
|
def mac(self, data, uid, algorithm):
|
||||||
super(DummyKmipClient, self).mac(uid, algorithm, data)
|
super(DummyKmipClient, self).mac(data, uid, algorithm)
|
||||||
|
|
||||||
|
|
||||||
class TestKmipClient(testtools.TestCase):
|
class TestKmipClient(testtools.TestCase):
|
||||||
@ -89,6 +98,14 @@ class TestKmipClient(testtools.TestCase):
|
|||||||
dummy = DummyKmipClient()
|
dummy = DummyKmipClient()
|
||||||
dummy.register('secret')
|
dummy.register('secret')
|
||||||
|
|
||||||
|
def test_locate(self):
|
||||||
|
"""
|
||||||
|
Test that the locate method can be called without error.
|
||||||
|
"""
|
||||||
|
dummy = DummyKmipClient()
|
||||||
|
dummy.locate('maximum_items', 'storage_status_mask',
|
||||||
|
'object_group_member', 'attributes')
|
||||||
|
|
||||||
def test_get(self):
|
def test_get(self):
|
||||||
"""
|
"""
|
||||||
Test that the get method can be called without error.
|
Test that the get method can be called without error.
|
||||||
@ -103,6 +120,13 @@ class TestKmipClient(testtools.TestCase):
|
|||||||
dummy = DummyKmipClient()
|
dummy = DummyKmipClient()
|
||||||
dummy.get_attribute_list('uid')
|
dummy.get_attribute_list('uid')
|
||||||
|
|
||||||
|
def test_activate(self):
|
||||||
|
"""
|
||||||
|
Test that the activate method can be called without error.
|
||||||
|
"""
|
||||||
|
dummy = DummyKmipClient()
|
||||||
|
dummy.activate('uid')
|
||||||
|
|
||||||
def test_destroy(self):
|
def test_destroy(self):
|
||||||
"""
|
"""
|
||||||
Test that the destroy method can be called without error.
|
Test that the destroy method can be called without error.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user