def trigger(self, hook): message = sysadminctl_pb2.Command() message.trigger.hook = hook message.id = rand_uint32() response = self._send(message) assert response.id == message.id return response
def rollback(self, id): message = sysadminctl_pb2.Command() message.rollback.id = id message.id = rand_uint32() response = self._send(message) assert response.id == message.id return response
def _genericEmptyCommand(self, field): message = sysadminctl_pb2.Command() getattr(message, field).SetInParent() message.id = rand_uint32() if hasattr(self, "xid"): message.xid = self.xid response = self._send(message) assert response.id == message.id return response
def _genericKeyCommand(self, command, key): message = sysadminctl_pb2.Command() setattr(getattr(message, command), "key", key) message.id = rand_uint32() if hasattr(self, "xid"): message.xid = self.xid response = self._send(message) assert response.id == message.id return response
def commit(self, opt=sysadminctl_pb2.DEFAULT): message = sysadminctl_pb2.Command() message.commit.config = opt message.id = rand_uint32() if hasattr(self, "xid"): message.xid = self.xid response = self._send(message) assert response.id == message.id return response
def set(self, key, value, override_type=None): message = sysadminctl_pb2.Command() message.set.key = key message.id = rand_uint32() if hasattr(self, "xid"): message.xid = self.xid if override_type is None: _unpackIntoProto(message.set.value, value) else: _overriddenTypeUnpack(message.set.value, value, override_type) response = self._send(message) assert response.id == message.id return response