def list_entities(self, kind=None): ''' Returns an iterable of Entities, optionally filtered by kind. ''' query = kama_pb2.Entity() if kind: query.kind = kind return self.stub.ListEntities(query)
def delete_entity(self, uuid): ''' Delete an Entity Required permissions: entity.delete ''' entity = kama_pb2.Entity() entity.uuid = uuid return self.stub.DeleteEntity(entity)
def get_entity_by_uuid(self, uuid): ''' Queries kama for an Entity with the given UUID Required permissions: entity.read_attribute entity.read_link entity.read_permission ''' entity = kama_pb2.Entity() entity.uuid = uuid return self.stub.GetEntity(entity)
def update_entity(self, uuid, name): ''' Rename an existing Entity Required permissions: entity.set_name ''' entity = kama_pb2.Entity() entity.uuid = uuid entity.name = name new_entity = self.stub.UpdateEntity(entity) return new_entity
def get_entity(self, kind, name): ''' Queries kama for an Entity with the given kind and name Required permissions: entity.read_attribute entity.read_link entity.read_permission ''' entity = kama_pb2.Entity() entity.kind = kind entity.name = name return self.stub.GetEntity(entity)